From 26b6857c4f889fa53bba58be46bff1abb9bb7d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 31 Jul 2025 17:33:04 +0200 Subject: [PATCH] follow up of commits making default value for dynamic maps a parameter pack the free function becomes a better match than with a default value for the default parameter --- .../graph/graph_traits_inheritance_macros.h | 79 ++++++++++--------- BGL/test/BGL/graph_traits_inheritance.cpp | 8 ++ 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h b/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h index 9a88014752d..9035d607764 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h @@ -67,23 +67,8 @@ template struct property_map > \ : property_map > \ {};\ -} /* boost namespace */\ -\ -namespace CGAL { \ -template \ -typename boost::property_map >::type \ -get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ -{ \ - return get(t, static_cast(g), default_value); \ -} \ -\ -template \ -typename boost::property_map >::const_type \ -get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ -{ \ - return get(t, static_cast(g), default_value); \ -}\ -} //CGAL namespace +} /* boost namespace */ + CGAL_PM_DT_SPEC(CGAL::dynamic_vertex_property_t) CGAL_PM_DT_SPEC(CGAL::dynamic_halfedge_property_t) @@ -94,12 +79,31 @@ CGAL_PM_DT_SPEC(CGAL::dynamic_edge_property_t) namespace CGAL { +template ()>, + typename ...Default_value_args> +auto +get(Dynamic_property_tag t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, Default_value_args&&... default_value_args) +{ + return get(t, static_cast(g), default_value_args...); +} + +template ()>, + typename ...Default_value_args> +auto +get(Dynamic_property_tag t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, Default_value_args&&... default_value_args) +{ + return get(t, static_cast(g), default_value_args...); +} + template struct graph_has_property : public CGAL::graph_has_property {}; - } // CGAL namespace #undef CGAL_GRAPH_TRAITS_INHERITANCE_TEMPLATE_PARAMS @@ -126,23 +130,8 @@ template \ struct property_map > \ : property_map > \ {};\ -} /* boost namespace */\ -\ -namespace CGAL { \ -template \ -typename boost::property_map >::type \ -get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ -{ \ - return get(t, static_cast(g), default_value); \ -} \ -\ -template \ -typename boost::property_map >::const_type \ -get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ -{ \ - return get(t, static_cast(g), default_value); \ -}\ -} //CGAL namespace +} /* boost namespace */ + CGAL_PM_DT_SPEC(CGAL::dynamic_vertex_property_t) CGAL_PM_DT_SPEC(CGAL::dynamic_halfedge_property_t) @@ -153,14 +142,32 @@ CGAL_PM_DT_SPEC(CGAL::dynamic_edge_property_t) namespace CGAL { +template ()>, + typename ...Default_value_args> +auto +get(Dynamic_property_tag t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, Default_value_args&&... default_value_args) +{ + return get(t, static_cast(g), default_value_args...); +} + +template ()>, + typename ...Default_value_args> +auto +get(Dynamic_property_tag t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, Default_value_args&&... default_value_args) +{ + return get(t, static_cast(g), default_value_args...); +} + template struct graph_has_property : public CGAL::graph_has_property {}; - } // CGAL namespace + #endif diff --git a/BGL/test/BGL/graph_traits_inheritance.cpp b/BGL/test/BGL/graph_traits_inheritance.cpp index fd4540af69e..80ecbd69820 100644 --- a/BGL/test/BGL/graph_traits_inheritance.cpp +++ b/BGL/test/BGL/graph_traits_inheritance.cpp @@ -4,6 +4,7 @@ #include #include #include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; @@ -75,5 +76,12 @@ int main() My_mesh_5 poly5; CGAL::convex_hull_3(points.begin(), points.end(), poly5); + + CGAL::Polygon_mesh_processing::non_manifold_vertices(poly1, CGAL::Emptyset_iterator()); + CGAL::Polygon_mesh_processing::non_manifold_vertices(poly2, CGAL::Emptyset_iterator()); + CGAL::Polygon_mesh_processing::non_manifold_vertices(poly3, CGAL::Emptyset_iterator()); + CGAL::Polygon_mesh_processing::non_manifold_vertices(poly4, CGAL::Emptyset_iterator()); + CGAL::Polygon_mesh_processing::non_manifold_vertices(poly5, CGAL::Emptyset_iterator()); + return 0; }