Merge branch 'VitaminCpp-missing_move_semantics_fix'
This commit is contained in:
@@ -33,6 +33,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
ScriptingObjectReferenceBase(ScriptingObjectReferenceBase&& other) noexcept
|
||||
: _object(nullptr)
|
||||
{
|
||||
OnSet(other._object);
|
||||
other.OnSet(nullptr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScriptingObjectReferenceBase"/> class.
|
||||
/// </summary>
|
||||
@@ -96,6 +103,16 @@ protected:
|
||||
void OnSet(ScriptingObject* object);
|
||||
|
||||
void OnDeleted(ScriptingObject* obj);
|
||||
|
||||
ScriptingObjectReferenceBase& operator=(ScriptingObjectReferenceBase&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
OnSet(other._object);
|
||||
other.OnSet(nullptr);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -133,6 +150,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
ScriptingObjectReference(ScriptingObjectReference&& other) noexcept
|
||||
: ScriptingObjectReferenceBase(MoveTemp(other))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes an instance of the <see cref="ScriptingObjectReference"/> class.
|
||||
/// </summary>
|
||||
@@ -173,6 +195,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
ScriptingObjectReference& operator=(ScriptingObjectReference&& other) noexcept
|
||||
{
|
||||
ScriptingObjectReferenceBase::operator=(MoveTemp(other));
|
||||
return *this;
|
||||
}
|
||||
|
||||
FORCE_INLINE ScriptingObjectReference& operator=(const Guid& id)
|
||||
{
|
||||
OnSet(static_cast<ScriptingObject*>(FindObject(id, T::GetStaticClass())));
|
||||
|
||||
Reference in New Issue
Block a user