From 54c6122cbd1f030f83b6a8079cc538ba6d9c390f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 27 Mar 2020 20:56:01 -0400 Subject: [PATCH] CToken: Mark move assignment operator as noexcept Allows containers and anything using std::move_if_noexcept to perform a move instead of a copy. --- Runtime/CToken.cpp | 2 +- Runtime/CToken.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/CToken.cpp b/Runtime/CToken.cpp index e30daf34f..38bfa24ed 100644 --- a/Runtime/CToken.cpp +++ b/Runtime/CToken.cpp @@ -112,7 +112,7 @@ CToken& CToken::operator=(const CToken& other) { } return *this; } -CToken& CToken::operator=(CToken&& other) { +CToken& CToken::operator=(CToken&& other) noexcept { Unlock(); RemoveRef(); x0_objRef = other.x0_objRef; diff --git a/Runtime/CToken.hpp b/Runtime/CToken.hpp index ba8722d2b..4cbd9ba5b 100644 --- a/Runtime/CToken.hpp +++ b/Runtime/CToken.hpp @@ -84,7 +84,7 @@ public: IObj* GetObj(); const IObj* GetObj() const { return const_cast(this)->GetObj(); } CToken& operator=(const CToken& other); - CToken& operator=(CToken&& other); + CToken& operator=(CToken&& other) noexcept; CToken() = default; CToken(const CToken& other); CToken(CToken&& other) noexcept;