diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp index dc7424386ac..a9b59a6ffaa 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_np_function.cpp @@ -53,7 +53,7 @@ void my_function_with_named_parameters(PolygonMesh& mesh, const NamedParameters& bool do_project = choose_parameter(get_parameter(np, internal_np::do_project), false); // If the NPs provide a vertex-normal-map use it, otherwise initialize the default one - VNM vnm = choose_parameter(get_parameter(np, internal_np::vertex_normal_map), get(Vector_map_tag(), mesh)); + VNM vnm = choose_parameter(get_parameter(np, internal_np::vertex_normal_map), Vector_map_tag(), mesh); if (is_default_parameter::value) Polygon_mesh_processing::compute_vertex_normals(mesh, vnm); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index a5313c72826..3a55845725c 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -359,6 +359,19 @@ const T& choose_parameter(const T& t) return t; } +// Version with three parameters for dynamic property maps +template +D choose_parameter(const internal_np::Param_not_found&, Dynamic_tag tag, PolygonMesh& pm) +{ + return get(tag, pm); +} + +template +const T& choose_parameter(const T& t, Dynamic_tag, PolygonMesh&) +{ + return t; +} + template struct is_default_parameter {