implemented move constructor for `TemplateSimplifier::TokenAndName` (#4390)

This commit is contained in:
Oliver Stöneberg 2022-08-21 17:02:03 +02:00 committed by GitHub
parent d351a97a0f
commit 670b872f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -234,6 +234,14 @@ TemplateSimplifier::TokenAndName::TokenAndName(const TokenAndName& other) :
mToken->templateSimplifierPointer(this);
}
TemplateSimplifier::TokenAndName::TokenAndName(TokenAndName&& other) :
mToken(other.mToken), mScope(std::move(other.mScope)), mName(std::move(other.mName)), mFullName(std::move(other.mFullName)),
mNameToken(other.mNameToken), mParamEnd(other.mParamEnd), mFlags(other.mFlags)
{
if (mToken)
mToken->templateSimplifierPointer(this);
}
TemplateSimplifier::TokenAndName::~TokenAndName()
{
if (mToken && mToken->templateSimplifierPointers())

View File

@ -148,6 +148,7 @@ public:
*/
TokenAndName(Token *token, std::string scope, const Token *nameToken, const Token *paramEnd);
TokenAndName(const TokenAndName& other);
TokenAndName(TokenAndName&& other);
~TokenAndName();
bool operator == (const TokenAndName & rhs) const {