From 74a0aa8c20606c2c4b606b8523c39e16585703dd Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 26 Apr 2023 17:10:19 +0200 Subject: [PATCH] Cstr_point_[23]: simplify the different overloads One perfect forwarding is enough. --- .../include/CGAL/Cartesian/function_objects.h | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index cbdbfe22ac7..1a014253fd6 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -3075,9 +3075,10 @@ namespace CartesianKernelFunctors { typedef const Point_2& type; }; + template Rep // Point_2 - operator()(Return_base_tag, Origin o) const - { return Rep(o); } + operator()(Return_base_tag, Args&& ...args) const + { return Rep(std::forward(args)...); } Rep // Point_2 operator()(Return_base_tag, const RT& x, const RT& y) const @@ -3151,23 +3152,10 @@ namespace CartesianKernelFunctors { typedef const Point_3& type; }; - + template Rep // Point_3 - operator()(Return_base_tag, Origin o) const - { return Rep(o); } - - Rep // Point_3 - operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const - { return Rep(x, y, z); } - - template - Rep // Point_3 - operator()(Return_base_tag, T1&& x, T2&& y, T3&& z) const - { return Rep(std::forward(x), std::forward(y), std::forward(z)); } - - Rep // Point_3 - operator()(Return_base_tag, const RT& x, const RT& y, const RT& z, const RT& w) const - { return Rep(x, y, z, w); } + operator()(Return_base_tag, Args&& ...args) const + { return Rep(std::forward(args)...); } const Point_3& operator()(const Point_3 & p) const