updated move assignments and swap operations to "N4258: Cleaning-up noexcept in the Library, Rev 3" with some customizations.

This commit is contained in:
Ion Gaztañaga committed 2015-01-19 00:18:44 +01:00
1 parent 18ad354dcf
commit dbafd61d4d
13 files changed
+94 -34

No files matched your search

+7 -2
View File
@@ -98,8 +98,9 @@ template <class Key, class Value, class KeyOfValue,
class Compare, class Allocator>
class flat_tree
{
typedef boost::container::vector<Value, Allocator> vector_t;
typedef Allocator allocator_t;
typedef boost::container::vector<Value, Allocator> vector_t;
typedef Allocator allocator_t;
typedef allocator_traits<Allocator> allocator_traits_type;
public:
typedef flat_tree_value_compare<Compare, Value, KeyOfValue> value_compare;
@@ -264,6 +265,8 @@ class flat_tree
{ m_data = x.m_data; return *this; }
flat_tree& operator=(BOOST_RV_REF(flat_tree) x)
BOOST_CONTAINER_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
&& boost::container::container_detail::is_nothrow_move_assignable<Compare>::value )
{ m_data = boost::move(x.m_data); return *this; }
public:
@@ -329,6 +332,8 @@ class flat_tree
{ return this->m_data.m_vect.max_size(); }
void swap(flat_tree& other)
BOOST_CONTAINER_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
&& boost::container::container_detail::is_nothrow_swappable<Compare>::value )
{ this->m_data.swap(other.m_data); }
public:
+18 -12
View File
@@ -471,16 +471,18 @@ class tree
>
{
typedef tree_value_compare
<Key, T, Compare, KeyOfValue> ValComp;
<Key, T, Compare, KeyOfValue> ValComp;
typedef typename container_detail::intrusive_tree_type
< Allocator, ValComp, Options::tree_type
, Options::optimize_size>::type Icont;
typedef container_detail::node_alloc_holder
<Allocator, Icont> AllocHolder;
<Allocator, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
typedef tree < Key, T, KeyOfValue
, Compare, Allocator, Options> ThisType;
, Compare, Allocator, Options> ThisType;
typedef typename AllocHolder::NodeAlloc NodeAlloc;
typedef boost::container::
allocator_traits<NodeAlloc> allocator_traits_type;
typedef typename AllocHolder::ValAlloc ValAlloc;
typedef typename AllocHolder::Node Node;
typedef typename Icont::iterator iiterator;
@@ -494,22 +496,22 @@ class tree
public:
typedef Key key_type;
typedef T value_type;
typedef Allocator allocator_type;
typedef Compare key_compare;
typedef T value_type;
typedef Allocator allocator_type;
typedef Compare key_compare;
typedef ValComp value_compare;
typedef typename boost::container::
allocator_traits<Allocator>::pointer pointer;
allocator_traits<Allocator>::pointer pointer;
typedef typename boost::container::
allocator_traits<Allocator>::const_pointer const_pointer;
allocator_traits<Allocator>::const_pointer const_pointer;
typedef typename boost::container::
allocator_traits<Allocator>::reference reference;
allocator_traits<Allocator>::reference reference;
typedef typename boost::container::
allocator_traits<Allocator>::const_reference const_reference;
allocator_traits<Allocator>::const_reference const_reference;
typedef typename boost::container::
allocator_traits<Allocator>::size_type size_type;
allocator_traits<Allocator>::size_type size_type;
typedef typename boost::container::
allocator_traits<Allocator>::difference_type difference_type;
allocator_traits<Allocator>::difference_type difference_type;
typedef difference_type tree_difference_type;
typedef pointer tree_pointer;
typedef const_pointer tree_const_pointer;
@@ -696,6 +698,8 @@ class tree
}
tree& operator=(BOOST_RV_REF(tree) x)
BOOST_CONTAINER_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
&& boost::container::container_detail::is_nothrow_move_assignable<Compare>::value )
{
BOOST_ASSERT(this != &x);
NodeAlloc &this_alloc = this->node_alloc();
@@ -820,6 +824,8 @@ class tree
{ return AllocHolder::max_size(); }
void swap(ThisType& x)
BOOST_CONTAINER_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
&& boost::container::container_detail::is_nothrow_swappable<Compare>::value )
{ AllocHolder::swap(x); }
public:
@@ -50,6 +50,7 @@ using ::boost::move_detail::is_nothrow_copy_constructible;
using ::boost::move_detail::is_nothrow_move_constructible;
using ::boost::move_detail::is_nothrow_copy_assignable;
using ::boost::move_detail::is_nothrow_move_assignable;
using ::boost::move_detail::is_nothrow_swappable;
using ::boost::move_detail::alignment_of;
using ::boost::move_detail::aligned_storage;
using ::boost::move_detail::nat;