refs #624 Swap functions, move constructors, and move assignment operators should all be noexcept where possible.

This commit is contained in:
Mathew Sutcliffe
2016-03-21 01:24:43 +00:00
parent b33781717e
commit 91494ea2e5
10 changed files with 37 additions and 36 deletions

View File

@@ -29,8 +29,8 @@ namespace BlackMisc
public:
LockGuard(const LockGuard &) = delete;
LockGuard &operator =(const LockGuard &) = delete;
LockGuard(LockGuard &&other) : m_movedFrom(true) { *this = std::move(other); }
LockGuard &operator =(LockGuard &&other) { std::swap(m_movedFrom, other.m_movedFrom); std::swap(m_rev, other.m_rev); return *this; }
LockGuard(LockGuard &&other) noexcept : m_movedFrom(true) { *this = std::move(other); }
LockGuard &operator =(LockGuard &&other) noexcept { std::swap(m_movedFrom, other.m_movedFrom); std::swap(m_rev, other.m_rev); return *this; }
~LockGuard()
{