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

@ -122,6 +122,19 @@ Value& Value::operator= (const Value& other)
return *this;
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
Value::Value (Value&& other) noexcept
: value (static_cast <ReferenceCountedObjectPtr <ValueSource>&&> (other.value))
{
}
Value& Value::operator= (Value&& other) noexcept
{
value = static_cast <ReferenceCountedObjectPtr <ValueSource>&&> (other.value);
return *this;
}
#endif
Value::~Value()
{
if (listeners.size() > 0)