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

@@ -74,7 +74,7 @@ namespace BlackMisc
/*!
* \brief Move constructor.
*/
CSequence(CSequence &&other) : m_pimpl(other.m_pimpl.take()) {}
CSequence(CSequence &&other) noexcept(std::is_nothrow_move_constructible<T>::value) : m_pimpl(other.m_pimpl.take()) {}
/*!
* \brief Copy assignment.
@@ -84,7 +84,7 @@ namespace BlackMisc
/*!
* \brief Move assignment.
*/
CSequence &operator =(CSequence && other) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
CSequence &operator =(CSequence && other) noexcept(std::is_nothrow_move_assignable<T>::value) { m_pimpl.reset(other.m_pimpl.take()); return *this; }
/*!
* \brief Create a new sequence with a specific implementation type.
@@ -138,7 +138,7 @@ namespace BlackMisc
/*!
* \brief Swap this sequence with another.
*/
void swap(CSequence &other) { m_pimpl.swap(other.m_pimpl); }
void swap(CSequence &other) noexcept { m_pimpl.swap(other.m_pimpl); }
/*!
* \brief Access an element by its index.