From 0aafb2f9be352b5ee8b87fbb6fd4af3dec81fe4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 31 Dec 2011 16:19:15 +0000 Subject: [PATCH] Merging into release branch for 1.49 [SVN r76247] --- doc/container.qbk | 4 +- .../container/allocator/allocator_traits.hpp | 17 ++--- include/boost/container/detail/flat_tree.hpp | 48 +++++-------- include/boost/container/detail/mpl.hpp | 4 ++ include/boost/container/detail/tree.hpp | 26 +++---- include/boost/container/flat_map.hpp | 50 +++++++------- include/boost/container/flat_set.hpp | 23 ++++--- include/boost/container/map.hpp | 25 +++---- include/boost/container/set.hpp | 38 +++++++---- include/boost/container/slist.hpp | 9 ++- include/boost/container/stable_vector.hpp | 19 +++--- include/boost/container/vector.hpp | 18 ++--- test/allocator_traits_test.cpp | 68 +++++++++++-------- 13 files changed, 186 insertions(+), 163 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index 54f37c3..9038c53 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -590,7 +590,9 @@ use [*Boost.Container]? There are several reasons for that: * Fixed bugs [@https://svn.boost.org/trac/boost/ticket/6205 #6205], [@https://svn.boost.org/trac/boost/ticket/6287 #6287], - [@https://svn.boost.org/trac/boost/ticket/4383 #4383]. + [@https://svn.boost.org/trac/boost/ticket/4383 #4383], + [@https://svn.boost.org/trac/boost/ticket/6336 #6336], + [@https://svn.boost.org/trac/boost/ticket/6335 #6335]. * Added `allocator_traits` support for both C++11 and C++03 compilers through an internal `allocator_traits` clone. diff --git a/include/boost/container/allocator/allocator_traits.hpp b/include/boost/container/allocator/allocator_traits.hpp index 34f526e..0192161 100644 --- a/include/boost/container/allocator/allocator_traits.hpp +++ b/include/boost/container/allocator/allocator_traits.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include //numeric_limits<>::max() #include //placement new @@ -118,27 +119,27 @@ struct allocator_traits pointer, value_type*) pointer; //const_pointer - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, + typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc, const_pointer, typename boost::intrusive::pointer_traits::template - rebind_pointer::type) + rebind_pointer) const_pointer; //reference typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, - reference, value_type&) + reference, typename container_detail::unvoid::type&) reference; //const_reference typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, - const_reference, const value_type&) + const_reference, const typename container_detail::unvoid::type&) const_reference; //void_pointer - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, + typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc, void_pointer, typename boost::intrusive::pointer_traits::template - rebind_pointer::type) + rebind_pointer) void_pointer; //const_void_pointer - typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, + typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc, const_void_pointer, typename boost::intrusive::pointer_traits::template - rebind_pointer::type) + rebind_pointer) const_void_pointer; //difference_type typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc, diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index 9ad5c0d..4443838 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -352,7 +352,7 @@ class flat_tree #ifdef BOOST_CONTAINER_PERFECT_FORWARDING template - iterator emplace_unique(Args&&... args) + std::pair emplace_unique(Args&&... args) { value_type && val = value_type(boost::forward(args)...); insert_commit_data data; @@ -361,7 +361,7 @@ class flat_tree if(ret.second){ ret.first = priv_insert_commit(data, boost::move(val)); } - return ret.first; + return ret; } template @@ -398,27 +398,28 @@ class flat_tree #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + std::pair \ + emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ + BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \ - BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ + BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ value_type &val = vval; \ insert_commit_data data; \ std::pair ret = priv_insert_unique_prepare(val, data); \ if(ret.second){ \ ret.first = priv_insert_commit(data, boost::move(val)); \ } \ - return ret.first; \ + return ret; \ } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint_unique(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ + BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \ - BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ + BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ value_type &val = vval; \ insert_commit_data data; \ std::pair ret = priv_insert_unique_prepare(hint, val, data); \ @@ -429,11 +430,11 @@ class flat_tree } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + iterator emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ + BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \ - BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ + BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ value_type &val = vval; \ iterator i = this->upper_bound(KeyOfValue()(val)); \ i = this->m_data.m_vect.insert(i, boost::move(val)); \ @@ -442,11 +443,11 @@ class flat_tree \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint_equal(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ + BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \ BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \ - BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ + BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \ value_type &val = vval; \ insert_commit_data data; \ priv_insert_equal_prepare(hint, val, data); \ @@ -743,23 +744,6 @@ class flat_tree for ( ; first != last; ++first) this->insert_equal(*first); } - -/* - template - void priv_insert_unique(FwdIt first, FwdIt last, std::forward_iterator_tag) - { - size_type len = static_cast(std::distance(first, last)); - this->reserve(this->size()+len); - priv_insert_unique(first, last, std::input_iterator_tag()); - } - - template - void priv_insert_unique(InIt first, InIt last, std::input_iterator_tag) - { - for ( ; first != last; ++first) - this->insert_unique(*first); - } -*/ }; template static const std::size_t value = 0; }; +template struct unvoid { typedef T type; }; +template <> struct unvoid { struct type { }; }; +template <> struct unvoid { struct type { }; }; + } //namespace container_detail { } //namespace container { } //namespace boost { diff --git a/include/boost/container/detail/tree.hpp b/include/boost/container/detail/tree.hpp index 2a60e11..6cd91ed 100644 --- a/include/boost/container/detail/tree.hpp +++ b/include/boost/container/detail/tree.hpp @@ -753,7 +753,7 @@ class rbtree } private: - iterator emplace_unique_impl(NodePtr p) + std::pair emplace_unique_impl(NodePtr p) { value_type &v = p->get_data(); insert_commit_data data; @@ -761,9 +761,11 @@ class rbtree this->insert_unique_check(KeyOfValue()(v), data); if(!ret.second){ Destroyer(this->node_alloc())(p); - return ret.first; + return ret; } - return iterator(iiterator(this->icont().insert_unique_commit(*p, data))); + return std::pair + ( iterator(iiterator(this->icont().insert_unique_commit(*p, data))) + , true ); } iterator emplace_unique_hint_impl(const_iterator hint, NodePtr p) @@ -784,7 +786,7 @@ class rbtree #ifdef BOOST_CONTAINER_PERFECT_FORWARDING template - iterator emplace_unique(Args&&... args) + std::pair emplace_unique(Args&&... args) { return this->emplace_unique_impl(AllocHolder::create_node(boost::forward(args)...)); } template @@ -809,32 +811,32 @@ class rbtree #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + std::pair emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ return this->emplace_unique_impl \ - (AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + (AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint_unique(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ return this->emplace_unique_hint_impl \ - (hint, AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + (hint, AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + iterator emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - NodePtr p(AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + NodePtr p(AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ return iterator(this->icont().insert_equal(this->icont().end(), *p)); \ } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint_equal(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - NodePtr p(AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ + NodePtr p(AllocHolder::create_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); \ return iterator(this->icont().insert_equal(hint.get(), *p)); \ } \ //! diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index bec26e3..2d4515b 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -515,8 +515,8 @@ class flat_map //! //! Note: If an element is inserted it might invalidate elements. iterator insert(const_iterator position, BOOST_RV_REF(value_type) x) - { return container_detail::force_copy( - m_flat_tree.insert_unique(container_detail::force(position), boost::move(container_detail::force(x)))); } + { return container_detail::force_copy + (m_flat_tree.insert_unique(container_detail::force(position), boost::move(container_detail::force(x)))); } //! Effects: Inserts an element move constructed from x in the container. //! p is a hint pointing to where the insert should start to search. @@ -548,7 +548,7 @@ class flat_map #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) - //! Effects: Inserts an object of type T constructed with + //! Effects: Inserts an object x of type T constructed with //! std::forward(args)... if and only if there is no element in the container //! with key equivalent to the key of x. //! @@ -561,8 +561,8 @@ class flat_map //! //! Note: If an element is inserted it might invalidate elements. template - iterator emplace(Args&&... args) - { return container_detail::force_copy(m_flat_tree.emplace_unique(boost::forward(args)...)); } + std::pair emplace(Args&&... args) + { return container_detail::force_copy< std::pair >(m_flat_tree.emplace_unique(boost::forward(args)...)); } //! Effects: Inserts an object of type T constructed with //! std::forward(args)... in the container if and only if there is @@ -578,22 +578,23 @@ class flat_map //! Note: If an element is inserted it might invalidate elements. template iterator emplace_hint(const_iterator hint, Args&&... args) - { return container_detail::force_copy(m_flat_tree.emplace_hint_unique(container_detail::force(hint), boost::forward(args)...)); } + { return container_detail::force_copy + (m_flat_tree.emplace_hint_unique(container_detail::force(hint), boost::forward(args)...)); } #else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return container_detail::force_copy(m_flat_tree.emplace_unique \ - (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ + std::pair emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return container_detail::force_copy< std::pair > \ + (m_flat_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return container_detail::force_copy(m_flat_tree.emplace_hint_unique \ - (container_detail::force(hint) \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return container_detail::force_copy(m_flat_tree.emplace_hint_unique \ + (container_detail::force(hint) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() @@ -631,7 +632,8 @@ class flat_map //! Complexity: Logarithmic search time plus erasure time //! linear to the elements with bigger keys. iterator erase(const_iterator first, const_iterator last) - { return container_detail::force_copy(m_flat_tree.erase(container_detail::force(first), container_detail::force(last))); } + { return container_detail::force_copy + (m_flat_tree.erase(container_detail::force(first), container_detail::force(last))); } //! Effects: erase(a.begin(),a.end()). //! @@ -1151,7 +1153,8 @@ class flat_multimap //! //! Note: If an element is inserted it might invalidate elements. iterator insert(const_iterator position, const value_type& x) - { return container_detail::force_copy(m_flat_tree.insert_equal(container_detail::force(position), container_detail::force(x))); } + { return container_detail::force_copy + (m_flat_tree.insert_equal(container_detail::force(position), container_detail::force(x))); } //! Effects: Inserts a value move constructed from x in the container. //! p is a hint pointing to where the insert should start to search. @@ -1237,16 +1240,16 @@ class flat_multimap #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return container_detail::force_copy(m_flat_tree.emplace_equal \ - (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ + iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return container_detail::force_copy(m_flat_tree.emplace_equal \ + (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return container_detail::force_copy(m_flat_tree.emplace_hint_equal \ - (container_detail::force(hint) \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return container_detail::force_copy(m_flat_tree.emplace_hint_equal \ + (container_detail::force(hint) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() @@ -1284,7 +1287,8 @@ class flat_multimap //! Complexity: Logarithmic search time plus erasure time //! linear to the elements with bigger keys. iterator erase(const_iterator first, const_iterator last) - { return container_detail::force_copy(m_flat_tree.erase(container_detail::force(first), container_detail::force(last))); } + { return container_detail::force_copy + (m_flat_tree.erase(container_detail::force(first), container_detail::force(last))); } //! Effects: erase(a.begin(),a.end()). //! diff --git a/include/boost/container/flat_set.hpp b/include/boost/container/flat_set.hpp index 9d40bdd..f367309 100644 --- a/include/boost/container/flat_set.hpp +++ b/include/boost/container/flat_set.hpp @@ -418,7 +418,7 @@ class flat_set #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) - //! Effects: Inserts an object of type T constructed with + //! Effects: Inserts an object x of type T constructed with //! std::forward(args)... if and only if there is no element in the container //! with key equivalent to the key of x. //! @@ -431,7 +431,7 @@ class flat_set //! //! Note: If an element is inserted it might invalidate elements. template - iterator emplace(Args&&... args) + std::pair emplace(Args&&... args) { return m_flat_tree.emplace_unique(boost::forward(args)...); } //! Effects: Inserts an object of type T constructed with @@ -454,14 +454,14 @@ class flat_set #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_flat_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + std::pair emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_flat_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_flat_tree.emplace_hint_unique \ - (hint BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + (hint BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() @@ -982,7 +982,8 @@ class flat_multiset { return this->insert(position, const_cast(x)); } template - iterator insert(const_iterator position, const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert( const_iterator position, const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_insert(position, u); } #endif @@ -1044,14 +1045,14 @@ class flat_multiset #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_flat_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_flat_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_flat_tree.emplace_hint_equal \ - (hint BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + (hint BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() diff --git a/include/boost/container/map.hpp b/include/boost/container/map.hpp index f77dfa8..8f7ecd4 100644 --- a/include/boost/container/map.hpp +++ b/include/boost/container/map.hpp @@ -504,18 +504,19 @@ class map #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) - //! Effects: Inserts an object of type T constructed with + //! Effects: Inserts an object x of type T constructed with //! std::forward(args)... in the container if and only if there is //! no element in the container with an equivalent key. //! p is a hint pointing to where the insert should start to search. //! - //! Returns: An iterator pointing to the element with key equivalent - //! to the key of x. + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. //! //! Complexity: Logarithmic in general, but amortized constant if t //! is inserted right before p. template - iterator emplace(Args&&... args) + std::pair emplace(Args&&... args) { return m_tree.emplace_unique(boost::forward(args)...); } //! Effects: Inserts an object of type T constructed with @@ -536,14 +537,14 @@ class map #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + std::pair emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_tree.emplace_hint_unique(hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() @@ -1138,14 +1139,14 @@ class multimap #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_tree.emplace_hint_equal(hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() diff --git a/include/boost/container/set.hpp b/include/boost/container/set.hpp index 3cf22b5..b25e701 100644 --- a/include/boost/container/set.hpp +++ b/include/boost/container/set.hpp @@ -340,7 +340,8 @@ class set { return this->insert(const_cast(x)); } template - std::pair insert(const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + std::pair insert(const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_insert(u); } #endif @@ -372,7 +373,8 @@ class set { return this->insert(position, const_cast(x)); } template - iterator insert(const_iterator position, const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert( const_iterator position, const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_insert(position, u); } #endif @@ -397,18 +399,22 @@ class set #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) - //! Effects: Inserts an object of type T constructed with + //! Effects: Inserts an object x of type T constructed with //! std::forward(args)... if and only if there is //! no element in the container with equivalent value. //! and returns the iterator pointing to the - //! newly inserted element. + //! newly inserted element. + //! + //! Returns: The bool component of the returned pair is true if and only + //! if the insertion takes place, and the iterator component of the pair + //! points to the element with key equivalent to the key of x. //! //! Throws: If memory allocation throws or //! T's in-place constructor throws. //! //! Complexity: Logarithmic. template - iterator emplace(Args&&... args) + std::pair emplace(Args&&... args) { return m_tree.emplace_unique(boost::forward(args)...); } //! Effects: Inserts an object of type T constructed with @@ -428,14 +434,14 @@ class set #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + std::pair emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_tree.emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_tree.emplace_hint_unique(hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() @@ -902,7 +908,8 @@ class multiset { return this->insert(const_cast(x)); } template - iterator insert(const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert(const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_insert(u); } #endif @@ -932,7 +939,8 @@ class multiset { return this->insert(position, const_cast(x)); } template - iterator insert(const_iterator position, const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert( const_iterator position, const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_insert(position, u); } #endif @@ -983,14 +991,14 @@ class multiset #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - { return m_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ + iterator emplace(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + { return m_tree.emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace_hint(const_iterator hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { return m_tree.emplace_hint_equal(hint \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _));} \ //! #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index a3c6dd9..1cdcdf1 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -638,7 +638,8 @@ class slist void push_front(T &x) { push_front(const_cast(x)); } template - void push_front(const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + void push_front(const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return priv_push_front(u); } #endif @@ -700,7 +701,8 @@ class slist { return this->insert_after(position, const_cast(x)); } template - iterator insert_after(const_iterator position, const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert_after( const_iterator position, const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return this->priv_insert_after(position, u); } #endif @@ -768,7 +770,8 @@ class slist { return this->insert(position, const_cast(x)); } template - iterator insert(const_iterator position, const U &u, typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) + iterator insert( const_iterator position, const U &u + , typename container_detail::enable_if_c::value && !::boost::has_move_emulation_enabled::value >::type* =0) { return this->priv_insert(position, u); } #endif diff --git a/include/boost/container/stable_vector.hpp b/include/boost/container/stable_vector.hpp index f4ea541..8c3287a 100644 --- a/include/boost/container/stable_vector.hpp +++ b/include/boost/container/stable_vector.hpp @@ -7,13 +7,14 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -/* Stable vector. - * - * Copyright 2008 Joaquin M Lopez Munoz. - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - */ +// Stable vector. +// +// Copyright 2008 Joaquin M Lopez Munoz. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_CONTAINER_STABLE_VECTOR_HPP #define BOOST_CONTAINER_STABLE_VECTOR_HPP @@ -140,8 +141,8 @@ struct node_type #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - node_type(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ - : value(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \ + node_type(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + : value(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \ {} \ //! #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index d7b2978..01483f9 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -1045,32 +1045,32 @@ class vector : private container_detail::vector_alloc_holder #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - void emplace_back(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + void emplace_back(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ - T* back_pos = container_detail::to_raw_pointer \ + T* back_pos = container_detail::to_raw_pointer \ (this->members_.m_start) + this->members_.m_size; \ if (this->members_.m_size < this->members_.m_capacity){ \ allocator_traits_type::construct (this->alloc() \ - , back_pos BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \ + , back_pos BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \ ++this->members_.m_size; \ } \ else{ \ - container_detail::BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg) \ + container_detail::BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg) \ proxy \ - (this->alloc() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + (this->alloc() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ priv_range_insert(back_pos, 1, proxy); \ } \ } \ \ BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ iterator emplace(const_iterator pos \ - BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ size_type pos_n = pos - cbegin(); \ - container_detail::BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg) \ + container_detail::BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg) \ proxy \ - (this->alloc() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ - priv_range_insert(container_detail::to_raw_pointer(pos.get_ptr()), 1, proxy); \ + (this->alloc() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + priv_range_insert(container_detail::to_raw_pointer(pos.get_ptr()), 1, proxy); \ return iterator(this->members_.m_start + pos_n); \ } \ //! diff --git a/test/allocator_traits_test.cpp b/test/allocator_traits_test.cpp index ed109d4..36e5a9e 100644 --- a/test/allocator_traits_test.cpp +++ b/test/allocator_traits_test.cpp @@ -15,6 +15,7 @@ #include #include #include +#include template class SimpleAllocator @@ -63,7 +64,7 @@ class SimpleSmartPtr T *ptr_; }; -template +template class ComplexAllocator { bool allocate_called_; @@ -76,17 +77,19 @@ class ComplexAllocator public: typedef T value_type; - typedef SimpleSmartPtr pointer; - typedef SimpleSmartPtr const_pointer; - typedef T & reference; - typedef const T & const_reference; - typedef SimpleSmartPtr void_pointer; - typedef SimpleSmartPtr const_void_pointer; - typedef signed short difference_type; - typedef unsigned short size_type; - typedef boost::true_type propagate_on_container_copy_assignment; - typedef boost::true_type propagate_on_container_move_assignment; - typedef boost::true_type propagate_on_container_swap; + typedef SimpleSmartPtr pointer; + typedef SimpleSmartPtr const_pointer; + typedef typename boost::container:: + container_detail::unvoid::type & reference; + typedef const typename boost::container:: + container_detail::unvoid::type & const_reference; + typedef SimpleSmartPtr void_pointer; + typedef SimpleSmartPtr const_void_pointer; + typedef signed short difference_type; + typedef unsigned short size_type; + typedef boost::true_type propagate_on_container_copy_assignment; + typedef boost::true_type propagate_on_container_move_assignment; + typedef boost::true_type propagate_on_container_swap; ComplexAllocator() : allocate_called_(false) @@ -120,10 +123,10 @@ class ComplexAllocator #define BOOST_PP_LOCAL_MACRO(n) \ template \ - void construct(U *p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + void construct(U *p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ { \ construct_called_ = true; \ - ::new (p) U (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ + ::new (p) U (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \ } \ // #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) @@ -187,8 +190,17 @@ class copymovable { return moved_; } }; +void test_void_allocator() +{ + boost::container::allocator_traits > stdtraits; (void)stdtraits; + boost::container::allocator_traits > simtraits; (void)simtraits; + boost::container::allocator_traits > comtraits; (void)comtraits; +} + int main() { + test_void_allocator(); + //SimpleAllocator BOOST_STATIC_ASSERT(( boost::is_same >::value_type, int>::value )); @@ -219,33 +231,33 @@ int main() //ComplexAllocator BOOST_STATIC_ASSERT(( boost::is_same >::value_type, int>::value )); + < ComplexAllocator >::value_type, int>::value )); BOOST_STATIC_ASSERT(( boost::is_same >::pointer, SimpleSmartPtr >::value )); + < ComplexAllocator >::pointer, SimpleSmartPtr >::value )); BOOST_STATIC_ASSERT(( boost::is_same >::const_pointer, SimpleSmartPtr >::value )); + < ComplexAllocator >::const_pointer, SimpleSmartPtr >::value )); BOOST_STATIC_ASSERT(( boost::is_same >::void_pointer, SimpleSmartPtr >::value )); + < ComplexAllocator >::void_pointer, SimpleSmartPtr >::value )); BOOST_STATIC_ASSERT(( boost::is_same >::const_void_pointer, SimpleSmartPtr >::value )); + < ComplexAllocator >::const_void_pointer, SimpleSmartPtr >::value )); BOOST_STATIC_ASSERT(( boost::is_same >::difference_type, signed short>::value )); + < ComplexAllocator >::difference_type, signed short>::value )); BOOST_STATIC_ASSERT(( boost::is_same >::size_type, unsigned short>::value )); + < ComplexAllocator >::size_type, unsigned short>::value )); BOOST_STATIC_ASSERT(( boost::container::allocator_traits - < ComplexAllocator >::propagate_on_container_copy_assignment::value == true )); + < ComplexAllocator >::propagate_on_container_copy_assignment::value == true )); BOOST_STATIC_ASSERT(( boost::container::allocator_traits - < ComplexAllocator >::propagate_on_container_move_assignment::value == true )); + < ComplexAllocator >::propagate_on_container_move_assignment::value == true )); BOOST_STATIC_ASSERT(( boost::container::allocator_traits - < ComplexAllocator >::propagate_on_container_swap::value == true )); + < ComplexAllocator >::propagate_on_container_swap::value == true )); BOOST_STATIC_ASSERT(( boost::is_same >::rebind_traits::allocator_type - , ComplexAllocator >::value )); + < ComplexAllocator >::rebind_traits::allocator_type + , ComplexAllocator >::value )); BOOST_STATIC_ASSERT(( boost::is_same >::rebind_alloc::value_type + < ComplexAllocator >::rebind_alloc::value_type , double >::value )); - typedef ComplexAllocator CAlloc; + typedef ComplexAllocator CAlloc; typedef SimpleAllocator SAlloc; typedef boost::container::allocator_traits CAllocTraits; typedef boost::container::allocator_traits SAllocTraits;