mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- give TMap a proper move constructor and assignment operator.
This commit is contained in:
parent
e74e581637
commit
6d958135e0
1 changed files with 18 additions and 0 deletions
|
@ -837,6 +837,18 @@ public:
|
|||
CopyNodes(o.Nodes, o.Size);
|
||||
}
|
||||
|
||||
TMap(TMap &&o)
|
||||
{
|
||||
Nodes = o.Nodes;
|
||||
LastFree = o.LastFree; /* any free position is before this position */
|
||||
Size = o.Size; /* must be a power of 2 */
|
||||
NumUsed = o.NumUsed;
|
||||
|
||||
o.Size = 0;
|
||||
o.NumUsed = 0;
|
||||
o.SetNodeVector(1);
|
||||
}
|
||||
|
||||
TMap &operator= (const TMap &o)
|
||||
{
|
||||
NumUsed = 0;
|
||||
|
@ -846,6 +858,12 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
TMap &operator= (TMap &&o)
|
||||
{
|
||||
TransferFrom(o);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//
|
||||
// TransferFrom
|
||||
|
|
Loading…
Reference in a new issue