1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Created c++11 move constructors and operator= methods for a bunch of classes (only enabled for c++11 compilers, of course)

This commit is contained in:
Julian Storer 2011-08-21 21:20:28 +01:00
parent 2c328dfedc
commit ffc2f5d40e
46 changed files with 629 additions and 39 deletions

View file

@ -114,6 +114,31 @@ Path& Path::operator= (const Path& other)
return *this;
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
Path::Path (Path&& other) noexcept
: data (static_cast <ArrayAllocationBase <float, DummyCriticalSection>&&> (other.data)),
numElements (other.numElements),
pathXMin (other.pathXMin),
pathXMax (other.pathXMax),
pathYMin (other.pathYMin),
pathYMax (other.pathYMax),
useNonZeroWinding (other.useNonZeroWinding)
{
}
Path& Path::operator= (Path&& other) noexcept
{
data = static_cast <ArrayAllocationBase <float, DummyCriticalSection>&&> (other.data);
numElements = other.numElements;
pathXMin = other.pathXMin;
pathXMax = other.pathXMax;
pathYMin = other.pathYMin;
pathYMax = other.pathYMax;
useNonZeroWinding = other.useNonZeroWinding;
return *this;
}
#endif
bool Path::operator== (const Path& other) const noexcept
{
return ! operator!= (other);