mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
implement move constructor
This commit is contained in:
parent
8958e29187
commit
a16727d5e3
3 changed files with 8 additions and 1 deletions
|
@ -171,7 +171,7 @@ namespace MWScript
|
|||
{
|
||||
Compiler::Locals locals;
|
||||
|
||||
Compiler::ContextRestore restore = mErrorHandler.setContext(name2 + "[local variables]", true);
|
||||
const Compiler::ContextRestore&& restore = mErrorHandler.setContext(name2 + "[local variables]", true);
|
||||
|
||||
std::istringstream stream (script->mScriptText);
|
||||
Compiler::QuickFileParser parser (mErrorHandler, mCompilerContext, locals);
|
||||
|
|
|
@ -72,6 +72,11 @@ namespace Compiler
|
|||
|
||||
ContextRestore::ContextRestore(StreamErrorHandler* handler, const std::string& context) : mHandler(handler), mContext(context) {}
|
||||
|
||||
ContextRestore::ContextRestore(ContextRestore&& other) : mHandler(other.mHandler), mContext(other.mContext)
|
||||
{
|
||||
other.mHandler = nullptr;
|
||||
}
|
||||
|
||||
ContextRestore::~ContextRestore()
|
||||
{
|
||||
if(mHandler)
|
||||
|
|
|
@ -42,6 +42,8 @@ namespace Compiler
|
|||
public:
|
||||
ContextRestore (StreamErrorHandler* handler, const std::string& context);
|
||||
|
||||
ContextRestore (ContextRestore&& other);
|
||||
|
||||
~ContextRestore();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue