Skip to content

Commit

Permalink
Revert "example of perfect forwarding for Point_3"
Browse files Browse the repository at this point in the history
This reverts commit 8a5fc31.
  • Loading branch information
sloriot committed Feb 27, 2024
1 parent 30e9eac commit 5ad84b0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 25 deletions.
5 changes: 0 additions & 5 deletions Cartesian_kernel/include/CGAL/Cartesian/Point_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class PointC3
PointC3(const FT &x, const FT &y, const FT &z)
: base(x, y, z) {}

PointC3(FT &&x, FT &&y, FT &&z)
: base(std::forward<FT>(x), std::forward<FT>(y), std::forward<FT>(z))
{}


PointC3(const FT &x, const FT &y, const FT &z, const FT &w)
: base(x, y, z, w) {}

Expand Down
5 changes: 1 addition & 4 deletions Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ class VectorC3
{ *this = R().construct_vector_3_object()(l); }

VectorC3(const FT_ &x, const FT_ &y, const FT_ &z)
: base(Rep{x, y, z}) {}

VectorC3(FT_ &&x, FT_ &&y, FT_ &&z)
: base(Rep{x, y, z}) {}
: base(CGAL::make_array(x, y, 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)
Expand Down
8 changes: 0 additions & 8 deletions Cartesian_kernel/include/CGAL/Cartesian/function_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -3160,10 +3160,6 @@ namespace CartesianKernelFunctors {
operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const
{ return Rep(x, y, z); }

Rep // Point_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 // 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); }
Expand All @@ -3184,10 +3180,6 @@ namespace CartesianKernelFunctors {
operator()(const RT& x, const RT& y, const RT& z) const
{ return Point_3(x, y, z); }

Point_3
operator()(RT&& x, RT&& y, RT&& z) const
{ return Point_3(std::forward<RT>(x), std::forward<RT>(y), std::forward<RT>(z)); }

Point_3
operator()(const RT& x, const RT& y, const RT& z, const RT& w) const
{ return Point_3(x, y, z, w); }
Expand Down
9 changes: 1 addition & 8 deletions Kernel_23/include/CGAL/Point_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ class Point_3 : public R_::Kernel_base::Point_3
: Rep(typename R::Construct_point_3()(Return_base_tag(), x, y, z))
{}

template < typename T1, typename T2, typename T3 >
Point_3(T1&& x, T2&& y, T3&& z)
: Rep(typename R::Construct_point_3()(Return_base_tag(), std::forward<T1>(x),
std::forward<T2>(y),
std::forward<T3>(z)))
{}

Point_3(const RT& hx, const RT& hy, const RT& hz, const RT& hw)
: Rep(typename R::Construct_point_3()(Return_base_tag(), hx, hy, hz, hw))
{}
Expand Down Expand Up @@ -290,7 +283,7 @@ extract(std::istream& is, Point_3<R>& p, const Cartesian_tag&)
break;
}
if (is)
p = Point_3<R>(std::move(x), std::move(y), std::move(z));
p = Point_3<R>(x, y, z);
return is;
}

Expand Down

0 comments on commit 5ad84b0

Please sign in to comment.