Skip to content

Commit

Permalink
move() -> forward<>()
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Apr 16, 2024
1 parent 267ab23 commit fcff28f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Polygon/include/CGAL/General_polygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class General_polygon_with_holes_2 {
{}

explicit General_polygon_with_holes_2(Polygon_2&& pgn_boundary) :
m_pgn(std::move(pgn_boundary))
m_pgn(std::forward<Polygon_2>(pgn_boundary))
{}

template <typename HolesInputIterator>
Expand All @@ -80,7 +80,7 @@ class General_polygon_with_holes_2 {
General_polygon_with_holes_2(Polygon_2&& pgn_boundary,
HolesInputIterator h_begin,
HolesInputIterator h_end) :
m_pgn(std::move(pgn_boundary)),
m_pgn(std::forward<Polygon_2>(pgn_boundary)),
m_holes(h_begin, h_end)
{}

Expand All @@ -104,7 +104,7 @@ class General_polygon_with_holes_2 {

void add_hole(const Polygon_2& pgn_hole) { m_holes.push_back(pgn_hole); }

void add_hole(Polygon_2&& pgn_hole) { m_holes.emplace_back(std::move(pgn_hole)); }
void add_hole(Polygon_2&& pgn_hole) { m_holes.emplace_back(std::forward<Polygon_2>(pgn_hole)); }

void erase_hole(Hole_iterator hit) { m_holes.erase(hit); }

Expand Down
2 changes: 1 addition & 1 deletion Polygon/include/CGAL/Multipolygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Multipolygon_with_holes_2 {

void add_polygon_with_holes(const Polygon_with_holes_2& pgn) { m_polygons.push_back(pgn); }

void add_polygon_with_holes(Polygon_with_holes_2&& pgn) { m_polygons.emplace_back(std::move(pgn)); }
void add_polygon_with_holes(Polygon_with_holes_2&& pgn) { m_polygons.emplace_back(std::forward<Polygon_with_holes_2>(pgn)); }

void push_back(const Polygon_with_holes_2& pgn) { m_polygons.push_back(pgn); }

Expand Down
4 changes: 2 additions & 2 deletions Polygon/include/CGAL/Polygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Polygon_with_holes_2 :

/*! Move constructor */
explicit Polygon_with_holes_2 (Polygon_2&& pgn_boundary) :
Base (std::move(pgn_boundary))
Base (std::forward<Polygon_2>(pgn_boundary))
{}

/*! Constructor from a polygon (outer boundary) and hole polygons. */
Expand All @@ -84,7 +84,7 @@ class Polygon_with_holes_2 :
Polygon_with_holes_2 (Polygon_2&& pgn_boundary,
HolesInputIterator h_begin,
HolesInputIterator h_end) :
Base (std::move(pgn_boundary), h_begin, h_end)
Base (std::forward<Polygon_2>(pgn_boundary), h_begin, h_end)
{}

/*! Obtain the bounding box of the polygon with holes */
Expand Down

0 comments on commit fcff28f

Please sign in to comment.