diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index 55862b39bc8..cf0df15df76 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -68,7 +68,7 @@ public: : base(Rep{x, y, z}) {} VectorC3(FT_ &&x, FT_ &&y, FT_ &&z) - : base(Rep{x, y, 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 effe3bf68a9..0425e888b54 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -3679,6 +3679,10 @@ namespace CartesianKernelFunctors { operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const { return Rep(x, y, z); } + 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)); } + Rep // Vector_3 operator()(Return_base_tag, const RT& x, const RT& y, const RT& z, const RT& w) const { return Rep(x, y, z, w); } diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index f81aee480f4..e8cf72bdf87 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -91,6 +91,13 @@ public: Vector_3(const T1 &x, const T2 &y, const T3 &z) : Rep(typename R::Construct_vector_3()(Return_base_tag(), x, y, z)) {} + template < typename T1, typename T2, typename T3 > + Vector_3(T1&& x, T2&& y, T3&& z) + : Rep(typename R::Construct_vector_3()(Return_base_tag(), std::forward(x), + std::forward(y), + std::forward(z))) + {} + Vector_3(const RT& x, const RT& y, const RT& z, const RT& w) : Rep(typename R::Construct_vector_3()(Return_base_tag(), x, y, z, w)) {}