From ae44cf3ff9a11ec247cac6c8478a6e74a43f0d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 23 Jul 2019 11:58:21 +0200 Subject: [PATCH] Do not return a const& for Named Parameters' default values Since 'd' is in general some default constructed value, things can get weird, for example with default constructed std::function --- BGL/include/CGAL/boost/graph/Named_function_parameters.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/Named_function_parameters.h b/BGL/include/CGAL/boost/graph/Named_function_parameters.h index cd1527a68b0..055bfeebc36 100644 --- a/BGL/include/CGAL/boost/graph/Named_function_parameters.h +++ b/BGL/include/CGAL/boost/graph/Named_function_parameters.h @@ -204,8 +204,7 @@ get_parameter(const Named_function_parameters& np, Query_tag tag) } template -const D& -choose_parameter(const internal_np::Param_not_found&, const D& d) +D choose_parameter(const internal_np::Param_not_found&, const D& d) { return d; }