Add move constructor to C4Value

qteditor
Günther Brammer 2016-05-05 01:37:09 +02:00
parent c2edd9b6fd
commit 5c6a805fd5
1 changed files with 12 additions and 0 deletions

View File

@ -69,6 +69,7 @@ public:
C4Value(const C4Value &nValue) : Data(nValue.Data), NextRef(NULL), Type(nValue.Type)
{ AddDataRef(); }
C4Value(C4Value && nValue) noexcept;
explicit C4Value(bool data): NextRef(NULL), Type(C4V_Bool)
{ Data.Int = data; }
@ -335,5 +336,16 @@ ALWAYS_INLINE void C4Value::Set0()
DelDataRef(oData, oType, NextRef);
}
ALWAYS_INLINE C4Value::C4Value(C4Value && nValue) noexcept:
Data(nValue.Data), NextRef(NULL), Type(nValue.Type)
{
if (Type == C4V_PropList)
{
Data.PropList->AddRef(this);
Data.PropList->DelRef(&nValue, nValue.NextRef);
}
nValue.Type = C4V_Nil; nValue.Data = 0; nValue.NextRef = NULL;
}
#endif