From c0ec1b96f5eac0bcdacb59d191b21c94efc041f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 7 Apr 2023 11:28:20 +0200 Subject: [PATCH] fix after Laurent's comment --- Cartesian_kernel/include/CGAL/Cartesian/Point_3.h | 5 +++-- .../include/CGAL/Cartesian/Vector_3.h | 5 +++-- .../include/CGAL/Cartesian/function_objects.h | 15 +++++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h index 205a9af6346..dbf142967b7 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h @@ -45,8 +45,9 @@ public: PointC3(const FT &x, const FT &y, const FT &z) : base(x, y, z) {} - PointC3(FT &&x, FT &&y, FT &&z) - : base(std::forward(x), std::forward(y), std::forward(z)) + template + PointC3(T1 &&x, T2 &&y, T3 &&z) + : base(std::forward(x), std::forward(y), std::forward(z)) {} diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index cf0df15df76..9d9d1bfdb6f 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -67,8 +67,9 @@ public: VectorC3(const FT_ &x, const FT_ &y, const FT_ &z) : base(Rep{x, y, z}) {} - VectorC3(FT_ &&x, FT_ &&y, FT_ &&z) - : base(Rep{std::forward(x), std::forward(y), std::forward(z)}) {} + template + VectorC3(T1 &&x, T2 &&y, T3 &&z) + : base(Rep{std::forward(x), std::forward(y), std::forward(z)}) {} VectorC3(const FT_ &x, const FT_ &y, const FT_ &z, const FT_ &w) : base( w != FT_(1) ? CGAL::make_array(x/w, y/w, z/w) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 0425e888b54..cbdbfe22ac7 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -3160,9 +3160,10 @@ namespace CartesianKernelFunctors { 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, RT&& x, RT&& y, RT&& z) const - { return Rep(std::forward(x), std::forward(y), std::forward(z)); } + 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 @@ -3184,9 +3185,10 @@ namespace CartesianKernelFunctors { operator()(const RT& x, const RT& y, const RT& z) const { return Point_3(x, y, z); } + template Point_3 - operator()(RT&& x, RT&& y, RT&& z) const - { return Point_3(std::forward(x), std::forward(y), std::forward(z)); } + operator()(T1&& x, T2&& y, T3&& z) const + { return Point_3(std::forward(x), std::forward(y), std::forward(z)); } Point_3 operator()(const RT& x, const RT& y, const RT& z, const RT& w) const @@ -3679,9 +3681,10 @@ namespace CartesianKernelFunctors { operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const { return Rep(x, y, z); } + template Rep // Vector_3 - operator()(Return_base_tag, RT&& x, RT&& y, RT&& z) const - { return Rep(std::forward(x), std::forward(y), std::forward(z)); } + operator()(Return_base_tag, T1&& x, T2&& y, T3&& z) const + { return Rep(std::forward(x), std::forward(y), std::forward(z)); } Rep // Vector_3 operator()(Return_base_tag, const RT& x, const RT& y, const RT& z, const RT& w) const