From 0030692103151fc0b048ee02b8600fe4cc958e8c Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 14 May 2026 15:53:16 +0200 Subject: [PATCH] Avoid awkward special case for point class --- src/geom.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/geom.hpp b/src/geom.hpp index 0adb54d36..6cf1ae219 100644 --- a/src/geom.hpp +++ b/src/geom.hpp @@ -200,17 +200,21 @@ class multigeometry_t using iterator = typename std::vector::iterator; using value_type = GEOM; - static constexpr bool FOR_POINT = std::is_same_v; - [[nodiscard]] std::size_t num_geometries() const noexcept { return m_geometry.size(); } - GEOM & - add_geometry(typename std::conditional_t geom) + GEOM &add_geometry(GEOM const &geom) + { + m_geometry.push_back(geom); + return m_geometry.back(); + } + + template + GEOM &add_geometry(T &&geom) { - m_geometry.push_back(std::forward(geom)); + m_geometry.push_back(std::forward(geom)); return m_geometry.back(); }