mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
Improvement of the move semantics on various objects:
The source object will be empty after the move operation.
This commit is contained in:
parent
d5f9db76b3
commit
29b986fa76
9 changed files with 79 additions and 52 deletions
|
@ -69,15 +69,16 @@ extern bool remove_small(Polygons &polys, double min_area);
|
|||
|
||||
// Append a vector of polygons at the end of another vector of polygons.
|
||||
inline void polygons_append(Polygons &dst, const Polygons &src) { dst.insert(dst.end(), src.begin(), src.end()); }
|
||||
#if SLIC3R_CPPVER >= 11
|
||||
|
||||
inline void polygons_append(Polygons &dst, Polygons &&src)
|
||||
{
|
||||
if (dst.empty())
|
||||
if (dst.empty()) {
|
||||
dst = std::move(src);
|
||||
else
|
||||
} else {
|
||||
std::move(std::begin(src), std::end(src), std::back_inserter(dst));
|
||||
src.clear();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void polygons_rotate(Polygons &polys, double angle)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue