mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 20:28:08 -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
|
@ -47,10 +47,12 @@ class MultiPoint
|
|||
void append(const Points::const_iterator &begin, const Points::const_iterator &end) { this->points.insert(this->points.end(), begin, end); }
|
||||
void append(Points &&src)
|
||||
{
|
||||
if (this->points.empty())
|
||||
if (this->points.empty()) {
|
||||
this->points = std::move(src);
|
||||
else
|
||||
std::move(std::begin(src), std::end(src), std::back_inserter(this->points));
|
||||
} else {
|
||||
this->points.insert(this->points.end(), src.begin(), src.end());
|
||||
src.clear();
|
||||
}
|
||||
}
|
||||
|
||||
bool intersection(const Line& line, Point* intersection) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue