mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +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::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);
|
std::istringstream stream (script->mScriptText);
|
||||||
Compiler::QuickFileParser parser (mErrorHandler, mCompilerContext, locals);
|
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(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()
|
ContextRestore::~ContextRestore()
|
||||||
{
|
{
|
||||||
if(mHandler)
|
if(mHandler)
|
||||||
|
|
|
@ -42,6 +42,8 @@ namespace Compiler
|
||||||
public:
|
public:
|
||||||
ContextRestore (StreamErrorHandler* handler, const std::string& context);
|
ContextRestore (StreamErrorHandler* handler, const std::string& context);
|
||||||
|
|
||||||
|
ContextRestore (ContextRestore&& other);
|
||||||
|
|
||||||
~ContextRestore();
|
~ContextRestore();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue