Fix GitHub #79 ("Mark small_vector move operations noexcept")

This commit is contained in:
Ion Gaztañaga
2018-11-11 00:20:22 +01:00
parent 0c26acd423
commit 059133a345
3 changed files with 6 additions and 0 deletions

View File

@@ -1252,6 +1252,7 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed serious bug in heterogeneous lookup functions (is_transparent was broken).
* Fixed bugs:
* [@https://github.com/boostorg/container/issues/79 GitHub #79: ['"Mark small_vector move operations noexcept"]].
* [@https://github.com/boostorg/container/issues/82 GitHub #82: ['"Function definition in header file"]].
* [@https://github.com/boostorg/container/issues/83 GitHub #83: ['"Iterator zero incrementing leads to assert on empty vector"]].
* [@https://github.com/boostorg/container/pull/85 GitHub #85: ['"container: misc-typos"]].

View File

@@ -608,6 +608,7 @@ class small_vector : public small_vector_base<T, Allocator>
{ this->move_construct_impl(other, other.get_stored_allocator()); }
BOOST_CONTAINER_FORCEINLINE small_vector(BOOST_RV_REF(small_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value)
: base_type(initial_capacity_t(), internal_capacity(), ::boost::move(other.get_stored_allocator()))
{ this->move_construct_impl(other, other.get_stored_allocator()); }
@@ -627,6 +628,9 @@ class small_vector : public small_vector_base<T, Allocator>
{ return static_cast<small_vector&>(this->base_type::operator=(static_cast<base_type const&>(other))); }
BOOST_CONTAINER_FORCEINLINE small_vector& operator=(BOOST_RV_REF(small_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value
&& (allocator_traits_type::propagate_on_container_move_assignment::value
|| allocator_traits_type::is_always_equal::value))
{ return static_cast<small_vector&>(this->base_type::operator=(BOOST_MOVE_BASE(base_type, other))); }
BOOST_CONTAINER_FORCEINLINE small_vector& operator=(const base_type &other)

View File

@@ -372,6 +372,7 @@ public:
//! @par Complexity
//! Linear O(N).
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(BOOST_RV_REF(static_vector) other)
BOOST_NOEXCEPT_IF(boost::container::dtl::is_nothrow_move_assignable<value_type>::value)
{
return static_cast<static_vector&>(base_t::operator=(BOOST_MOVE_BASE(base_t, other)));
}