ENGINES: Move semantics for PauseToken
Only compilers who understands move semantics see the code.
This commit is contained in:
parent
f5ac623cca
commit
830a239b04
2 changed files with 38 additions and 5 deletions
|
@ -863,3 +863,17 @@ PauseToken::~PauseToken() {
|
|||
_engine->resumeEngine();
|
||||
}
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
PauseToken::PauseToken(PauseToken &&t2) : _engine(t2._engine) {
|
||||
t2._engine = nullptr;
|
||||
}
|
||||
|
||||
void PauseToken::operator=(PauseToken &&t2) {
|
||||
if (_engine) {
|
||||
error("Tried to assign to an already busy PauseToken");
|
||||
}
|
||||
_engine = t2._engine;
|
||||
t2._engine = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue