1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +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

@ -605,6 +605,19 @@ ValueTree& ValueTree::operator= (const ValueTree& other)
return *this;
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
ValueTree::ValueTree (ValueTree&& other) noexcept
: object (static_cast <SharedObjectPtr&&> (other.object))
{
}
ValueTree& ValueTree::operator= (ValueTree&& other) noexcept
{
object = static_cast <SharedObjectPtr&&> (other.object);
return *this;
}
#endif
ValueTree::~ValueTree()
{
if (listeners.size() > 0 && object != nullptr)