mirror of https://github.com/AxioDL/metaforce.git
CToken: Mark CToken's move constructor noexcept
The move constructor doesn't perform any behavior that would result in an exception being thrown. Marking it as noexcept allows the type to play nicely with facilities that make use of std::is_move_constructible to determine whether copies can be avoided or not in certain circumstances (e.g. the standard library; notably, std::vector). We can't mark the move assignment operator as noexcept currently, however, as it calls into interfaces outside of CToken.
This commit is contained in:
parent
79ac5d76df
commit
2014650d58
|
@ -128,7 +128,7 @@ CToken::CToken(const CToken& other) : x0_objRef(other.x0_objRef) {
|
|||
Lock();
|
||||
}
|
||||
}
|
||||
CToken::CToken(CToken&& other) : x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld) {
|
||||
CToken::CToken(CToken&& other) noexcept : x0_objRef(other.x0_objRef), x4_lockHeld(other.x4_lockHeld) {
|
||||
other.x0_objRef = nullptr;
|
||||
other.x4_lockHeld = false;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
CToken& operator=(CToken&& other);
|
||||
CToken() = default;
|
||||
CToken(const CToken& other);
|
||||
CToken(CToken&& other);
|
||||
CToken(CToken&& other) noexcept;
|
||||
CToken(IObj* obj);
|
||||
CToken(std::unique_ptr<IObj>&& obj);
|
||||
const SObjectTag* GetObjectTag() const;
|
||||
|
|
Loading…
Reference in New Issue