Improvement of the move semantics on various objects:

The source object will be empty after the move operation.
This commit is contained in:
bubnikv 2017-01-20 14:39:44 +01:00
parent d5f9db76b3
commit 29b986fa76
9 changed files with 79 additions and 52 deletions

View file

@ -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)
{