More forwarding

This commit is contained in:
Andreas Fabri 2023-04-06 17:49:24 +01:00
parent 8d062a88ce
commit 6dec6c320d
3 changed files with 12 additions and 1 deletions

View File

@ -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<FT_>(x), std::forward<FT_>(y), std::forward<FT_>(z)}) {}
VectorC3(const FT_ &x, const FT_ &y, const FT_ &z, const FT_ &w)
: base( w != FT_(1) ? CGAL::make_array<FT_>(x/w, y/w, z/w)

View File

@ -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<RT>(x), std::forward<RT>(y), std::forward<RT>(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); }

View File

@ -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<T1>(x),
std::forward<T2>(y),
std::forward<T3>(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)) {}