diff --git a/include/boost/container/container_fwd.hpp b/include/boost/container/container_fwd.hpp index e4fe6f8..ddc9a4d 100644 --- a/include/boost/container/container_fwd.hpp +++ b/include/boost/container/container_fwd.hpp @@ -94,8 +94,8 @@ template class new_allocator; template - ,class Options = void> + ,class Allocator = void + ,class Options = void> class vector; template ::value || trivial_assign; }; +template +struct real_allocator +{ + typedef AllocatorOrVoid type; +}; + +template +struct real_allocator +{ + typedef new_allocator type; +}; template struct vector_value_traits @@ -265,12 +276,12 @@ struct vector_alloc_holder BOOST_MOVABLE_BUT_NOT_COPYABLE(vector_alloc_holder) public: - typedef Allocator allocator_type; - typedef StoredSizeType stored_size_type; - typedef boost::container::allocator_traits allocator_traits_type; - typedef typename allocator_traits_type::pointer pointer; - typedef typename allocator_traits_type::size_type size_type; - typedef typename allocator_traits_type::value_type value_type; + typedef Allocator allocator_type; + typedef StoredSizeType stored_size_type; + typedef boost::container::allocator_traits allocator_traits_type; + typedef typename allocator_traits_type::pointer pointer; + typedef typename allocator_traits_type::size_type size_type; + typedef typename allocator_traits_type::value_type value_type; static bool is_propagable_from(const allocator_type &from_alloc, pointer p, const allocator_type &to_alloc, bool const propagate_allocator) { @@ -290,20 +301,20 @@ struct vector_alloc_holder //Constructor, does not throw vector_alloc_holder() - BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) - : Allocator(), m_start(), m_size(), m_capacity() + BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) + : allocator_type(), m_start(), m_size(), m_capacity() {} //Constructor, does not throw template explicit vector_alloc_holder(BOOST_FWD_REF(AllocConvertible) a) BOOST_NOEXCEPT_OR_NOTHROW - : Allocator(boost::forward(a)), m_start(), m_size(), m_capacity() + : allocator_type(boost::forward(a)), m_start(), m_size(), m_capacity() {} //Constructor, does not throw template vector_alloc_holder(vector_uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size) - : Allocator(boost::forward(a)) + : allocator_type(boost::forward(a)) , m_start() //Size is initialized here so vector should only call uninitialized_xxx after this , m_size(static_cast(initial_size)) @@ -319,7 +330,7 @@ struct vector_alloc_holder //Constructor, does not throw vector_alloc_holder(vector_uninitialized_size_t, size_type initial_size) - : Allocator() + : allocator_type() , m_start() //Size is initialized here so vector should only call uninitialized_xxx after this , m_size(static_cast(initial_size)) @@ -334,7 +345,7 @@ struct vector_alloc_holder } vector_alloc_holder(BOOST_RV_REF(vector_alloc_holder) holder) BOOST_NOEXCEPT_OR_NOTHROW - : Allocator(BOOST_MOVE_BASE(Allocator, holder)) + : allocator_type(BOOST_MOVE_BASE(allocator_type, holder)) , m_start(holder.m_start) , m_size(holder.m_size) , m_capacity(holder.m_capacity) @@ -344,7 +355,7 @@ struct vector_alloc_holder } vector_alloc_holder(initial_capacity_t, pointer p, size_type capacity, BOOST_RV_REF(vector_alloc_holder) holder) - : Allocator(BOOST_MOVE_BASE(Allocator, holder)) + : allocator_type(BOOST_MOVE_BASE(allocator_type, holder)) , m_start(p) , m_size(holder.m_size) , m_capacity(static_cast(capacity)) @@ -373,8 +384,8 @@ struct vector_alloc_holder } vector_alloc_holder(initial_capacity_t, pointer p, size_type n) - BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) - : Allocator() + BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) + : allocator_type() , m_start(p) , m_size() //n is guaranteed to fit into stored_size_type @@ -383,7 +394,7 @@ struct vector_alloc_holder template vector_alloc_holder(initial_capacity_t, pointer p, size_type n, BOOST_FWD_REF(AllocFwd) a) - : Allocator(::boost::forward(a)) + : allocator_type(::boost::forward(a)) , m_start(p) , m_size() , m_capacity(n) @@ -399,7 +410,7 @@ struct vector_alloc_holder BOOST_CONTAINER_FORCEINLINE pointer allocation_command(boost::container::allocation_type command, size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse) { - typedef typename dtl::version::type alloc_version; + typedef typename dtl::version::type alloc_version; return this->priv_allocation_command(alloc_version(), command, limit_size, prefer_in_recvd_out_size, reuse); } @@ -470,10 +481,10 @@ struct vector_alloc_holder x.m_size = x.m_capacity = 0; } - BOOST_CONTAINER_FORCEINLINE Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE allocator_type &alloc() BOOST_NOEXCEPT_OR_NOTHROW { return *this; } - BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW { return *this; } BOOST_CONTAINER_FORCEINLINE const pointer &start() const BOOST_NOEXCEPT_OR_NOTHROW @@ -553,31 +564,33 @@ struct vector_alloc_holder BOOST_MOVABLE_BUT_NOT_COPYABLE(vector_alloc_holder) public: - typedef boost::container::allocator_traits allocator_traits_type; + typedef Allocator allocator_type; + typedef boost::container:: + allocator_traits allocator_traits_type; typedef typename allocator_traits_type::pointer pointer; typedef typename allocator_traits_type::size_type size_type; typedef typename allocator_traits_type::value_type value_type; typedef StoredSizeType stored_size_type; - + template friend struct vector_alloc_holder; //Constructor, does not throw vector_alloc_holder() - BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) - : Allocator(), m_size() + BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) + : allocator_type(), m_size() {} //Constructor, does not throw template explicit vector_alloc_holder(BOOST_FWD_REF(AllocConvertible) a) BOOST_NOEXCEPT_OR_NOTHROW - : Allocator(boost::forward(a)), m_size() + : allocator_type(boost::forward(a)), m_size() {} //Constructor, does not throw template vector_alloc_holder(vector_uninitialized_size_t, BOOST_FWD_REF(AllocConvertible) a, size_type initial_size) - : Allocator(boost::forward(a)) + : allocator_type(boost::forward(a)) , m_size(initial_size) //Size is initialized here... { //... and capacity here, so vector, must call uninitialized_xxx in the derived constructor @@ -586,7 +599,7 @@ struct vector_alloc_holder //Constructor, does not throw vector_alloc_holder(vector_uninitialized_size_t, size_type initial_size) - : Allocator() + : allocator_type() , m_size(initial_size) //Size is initialized here... { //... and capacity here, so vector, must call uninitialized_xxx in the derived constructor @@ -594,7 +607,7 @@ struct vector_alloc_holder } vector_alloc_holder(BOOST_RV_REF(vector_alloc_holder) holder) - : Allocator(BOOST_MOVE_BASE(Allocator, holder)) + : allocator_type(BOOST_MOVE_BASE(allocator_type, holder)) , m_size(holder.m_size) //Size is initialized here so vector should only call uninitialized_xxx after this { ::boost::container::uninitialized_move_alloc_n @@ -603,7 +616,7 @@ struct vector_alloc_holder template vector_alloc_holder(BOOST_RV_REF_BEG vector_alloc_holder BOOST_RV_REF_END holder) - : Allocator() + : allocator_type() , m_size(holder.m_size) //Initialize it to m_size as first_allocation can only succeed or abort { //Different allocator type so we must check we have enough storage @@ -615,7 +628,7 @@ struct vector_alloc_holder BOOST_CONTAINER_FORCEINLINE void priv_first_allocation(size_type cap) { - if(cap > Allocator::internal_capacity){ + if(cap > allocator_type::internal_capacity){ throw_bad_alloc(); } } @@ -628,7 +641,8 @@ struct vector_alloc_holder template void deep_swap(vector_alloc_holder &x) { - if(this->m_size > OtherAllocator::internal_capacity || x.m_size > Allocator::internal_capacity){ + typedef typename real_allocator::type other_allocator_type; + if(this->m_size > other_allocator_type::internal_capacity || x.m_size > allocator_type::internal_capacity){ throw_bad_alloc(); } this->priv_deep_swap(x); @@ -645,17 +659,21 @@ struct vector_alloc_holder throw_bad_alloc(); } - BOOST_CONTAINER_FORCEINLINE Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE allocator_type &alloc() BOOST_NOEXCEPT_OR_NOTHROW { return *this; } - BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW + BOOST_CONTAINER_FORCEINLINE const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW { return *this; } BOOST_CONTAINER_FORCEINLINE bool try_expand_fwd(size_type at_least) { return !at_least; } - BOOST_CONTAINER_FORCEINLINE pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); } - BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; } + BOOST_CONTAINER_FORCEINLINE pointer start() const BOOST_NOEXCEPT_OR_NOTHROW + { return allocator_type::internal_storage(); } + + BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW + { return allocator_type::internal_capacity; } + stored_size_type m_size; private: @@ -663,7 +681,7 @@ struct vector_alloc_holder template void priv_deep_swap(vector_alloc_holder &x) { - const size_type MaxTmpStorage = sizeof(value_type)*Allocator::internal_capacity; + const size_type MaxTmpStorage = sizeof(value_type)*allocator_type::internal_capacity; value_type *const first_this = boost::movelib::to_raw_pointer(this->start()); value_type *const first_x = boost::movelib::to_raw_pointer(x.start()); @@ -714,14 +732,39 @@ struct get_vector_opt //! elements in a vector may vary dynamically; memory management is automatic. //! //! \tparam T The type of object that is stored in the vector -//! \tparam Allocator The allocator used for all internal memory management +//! \tparam A The allocator used for all internal memory management, use void +//! for the default allocator //! \tparam Options A type produced from \c boost::container::vector_options. -template ), class Options BOOST_CONTAINER_DOCONLY(= void) > +template class vector { - #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED +public: + ////////////////////////////////////////////// + // + // types + // + ////////////////////////////////////////////// + typedef T value_type; + typedef BOOST_CONTAINER_IMPDEF + (typename real_allocator::type) allocator_type; + typedef ::boost::container::allocator_traits allocator_traits_t; + typedef typename allocator_traits::pointer pointer; + typedef typename allocator_traits::const_pointer const_pointer; + typedef typename allocator_traits::reference reference; + typedef typename allocator_traits::const_reference const_reference; + typedef typename allocator_traits::size_type size_type; + typedef typename allocator_traits::difference_type difference_type; + typedef allocator_type stored_allocator_type; + typedef BOOST_CONTAINER_IMPDEF(vec_iterator) iterator; + typedef BOOST_CONTAINER_IMPDEF(vec_iterator) const_iterator; + typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator) reverse_iterator; + typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator) const_reverse_iterator; - typedef typename boost::container::allocator_traits::size_type alloc_size_type; +private: + + #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED + typedef typename boost::container:: + allocator_traits::size_type alloc_size_type; typedef typename get_vector_opt::type options_type; typedef typename options_type::growth_factor_type growth_factor_type; typedef typename options_type::stored_size_type stored_size_type; @@ -731,51 +774,32 @@ class vector BOOST_STATIC_ASSERT( (sizeof(stored_size_type) < sizeof(alloc_size_type) || dtl::is_same::value) ); - typedef typename dtl::version::type alloc_version; - typedef boost::container::vector_alloc_holder alloc_holder_t; + typedef typename dtl::version::type alloc_version; + typedef boost::container::vector_alloc_holder + alloc_holder_t; + alloc_holder_t m_holder; - typedef allocator_traits allocator_traits_type; - template + + typedef allocator_traits allocator_traits_type; + template friend class vector; - typedef typename allocator_traits_type::pointer pointer_impl; - typedef vec_iterator iterator_impl; - typedef vec_iterator const_iterator_impl; protected: - static bool is_propagable_from(const Allocator &from_alloc, pointer_impl p, const Allocator &to_alloc, bool const propagate_allocator) + BOOST_CONTAINER_FORCEINLINE + static bool is_propagable_from(const allocator_type &from_alloc, pointer p, const allocator_type &to_alloc, bool const propagate_allocator) { return alloc_holder_t::is_propagable_from(from_alloc, p, to_alloc, propagate_allocator); } - static bool are_swap_propagable( const Allocator &l_a, pointer_impl l_p - , const Allocator &r_a, pointer_impl r_p, bool const propagate_allocator) + BOOST_CONTAINER_FORCEINLINE + static bool are_swap_propagable( const allocator_type &l_a, pointer l_p + , const allocator_type &r_a, pointer r_p, bool const propagate_allocator) { return alloc_holder_t::are_swap_propagable(l_a, l_p, r_a, r_p, propagate_allocator); } #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED - public: - ////////////////////////////////////////////// - // - // types - // - ////////////////////////////////////////////// - - typedef T value_type; - typedef typename ::boost::container::allocator_traits::pointer pointer; - typedef typename ::boost::container::allocator_traits::const_pointer const_pointer; - typedef typename ::boost::container::allocator_traits::reference reference; - typedef typename ::boost::container::allocator_traits::const_reference const_reference; - typedef typename ::boost::container::allocator_traits::size_type size_type; - typedef typename ::boost::container::allocator_traits::difference_type difference_type; - typedef Allocator allocator_type; - typedef Allocator stored_allocator_type; - typedef BOOST_CONTAINER_IMPDEF(iterator_impl) iterator; - typedef BOOST_CONTAINER_IMPDEF(const_iterator_impl) const_iterator; - typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator) reverse_iterator; - typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator) const_reverse_iterator; - #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: BOOST_COPYABLE_AND_MOVABLE(vector) - typedef vector_value_traits value_traits; + typedef vector_value_traits value_traits; typedef constant_iterator cvalue_iterator; protected: @@ -806,7 +830,7 @@ class vector //! Throws: Nothing. //! //! Complexity: Constant. - vector() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) + vector() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) : m_holder() {} @@ -1021,10 +1045,10 @@ class vector //! Complexity: Linear. //! //! Note: Non-standard extension to support static_vector - template - vector(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x + template + vector(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x , typename dtl::enable_if_c - < dtl::is_version::value>::type * = 0 + < dtl::is_version::type, 0>::value>::type * = 0 ) : m_holder(boost::move(x.m_holder)) {} @@ -1099,7 +1123,7 @@ class vector //! Complexity: Linear to the number of elements in x. BOOST_CONTAINER_FORCEINLINE vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x) { - if (&x != this){ + if (BOOST_LIKELY(&x != this)){ this->priv_copy_assign(x); } return *this; @@ -1131,7 +1155,9 @@ class vector BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value || allocator_traits_type::is_always_equal::value) { - this->priv_move_assign(boost::move(x)); + if (BOOST_LIKELY(&x != this)){ + this->priv_move_assign(boost::move(x)); + } return *this; } @@ -1147,13 +1173,13 @@ class vector //! Complexity: Linear. //! //! Note: Non-standard extension to support static_vector - template + template BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and < vector& - , dtl::is_version - , dtl::is_different + , dtl::is_version::type, 0> + , dtl::is_different::type, allocator_type> >::type - operator=(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x) + operator=(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x) { this->priv_move_assign(boost::move(x)); return *this; @@ -1169,13 +1195,13 @@ class vector //! Complexity: Linear. //! //! Note: Non-standard extension to support static_vector - template + template BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and < vector& - , dtl::is_version - , dtl::is_different + , dtl::is_version::type, 0> + , dtl::is_different::type, allocator_type> >::type - operator=(const vector &x) + operator=(const vector &x) { this->priv_copy_assign(x); return *this; @@ -1765,7 +1791,7 @@ class vector return *p; } else{ - typedef dtl::insert_emplace_proxy type; + typedef dtl::insert_emplace_proxy type; return *this->priv_forward_range_insert_no_capacity (this->back_ptr(), 1, type(::boost::forward(args)...), alloc_version()); } @@ -1806,7 +1832,7 @@ class vector { BOOST_ASSERT(this->priv_in_range_or_end(position)); //Just call more general insert(pos, size, value) and return iterator - typedef dtl::insert_emplace_proxy type; + typedef dtl::insert_emplace_proxy type; return this->priv_forward_range_insert( vector_iterator_get_ptr(position), 1 , type(::boost::forward(args)...)); } @@ -1825,7 +1851,7 @@ class vector return *p;\ }\ else{\ - typedef dtl::insert_emplace_proxy_arg##N type;\ + typedef dtl::insert_emplace_proxy_arg##N type;\ return *this->priv_forward_range_insert_no_capacity\ ( this->back_ptr(), 1, type(BOOST_MOVE_FWD##N), alloc_version());\ }\ @@ -1847,7 +1873,7 @@ class vector iterator emplace(const_iterator pos BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ {\ BOOST_ASSERT(this->priv_in_range_or_end(pos));\ - typedef dtl::insert_emplace_proxy_arg##N type;\ + typedef dtl::insert_emplace_proxy_arg##N type;\ return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), 1, type(BOOST_MOVE_FWD##N));\ }\ // @@ -1913,7 +1939,7 @@ class vector iterator insert(const_iterator p, size_type n, const T& x) { BOOST_ASSERT(this->priv_in_range_or_end(p)); - dtl::insert_n_copies_proxy proxy(x); + dtl::insert_n_copies_proxy proxy(x); return this->priv_forward_range_insert(vector_iterator_get_ptr(p), n, proxy); } @@ -1959,7 +1985,7 @@ class vector ) { BOOST_ASSERT(this->priv_in_range_or_end(pos)); - dtl::insert_range_proxy proxy(first); + dtl::insert_range_proxy proxy(first); return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), boost::container::iterator_distance(first, last), proxy); } #endif @@ -1987,7 +2013,7 @@ class vector BOOST_ASSERT(dtl::is_input_iterator::value || num == static_cast(boost::container::iterator_distance(first, last))); (void)last; - dtl::insert_range_proxy proxy(first); + dtl::insert_range_proxy proxy(first); return this->priv_forward_range_insert(vector_iterator_get_ptr(pos), num, proxy); } #endif @@ -2066,9 +2092,9 @@ class vector BOOST_CONTAINER_FORCEINLINE void swap(vector& x) BOOST_NOEXCEPT_IF( ((allocator_traits_type::propagate_on_container_swap::value || allocator_traits_type::is_always_equal::value) && - !dtl::is_version::value)) + !dtl::is_version::value)) { - this->priv_swap(x, dtl::bool_::value>()); + this->priv_swap(x, dtl::bool_::value>()); } #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -2080,12 +2106,12 @@ class vector //! Complexity: Linear //! //! Note: Non-standard extension to support static_vector - template - BOOST_CONTAINER_FORCEINLINE void swap(vector & x + template + BOOST_CONTAINER_FORCEINLINE void swap(vector & x , typename dtl::enable_if_and < void - , dtl::is_version - , dtl::is_different + , dtl::is_version::type, 0> + , dtl::is_different::type, allocator_type> >::type * = 0 ) { this->m_holder.deep_swap(x.m_holder); } @@ -2380,12 +2406,12 @@ class vector return static_cast(p - this->m_holder.start()); } - template - void priv_move_assign(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x + template + void priv_move_assign(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x , typename dtl::enable_if_c - < dtl::is_version::value >::type * = 0) + < dtl::is_version::type, 0>::value >::type * = 0) { - if(!dtl::is_same::value && + if(!dtl::is_same::type, allocator_type>::value && this->capacity() < x.size()){ throw_bad_alloc(); } @@ -2397,12 +2423,12 @@ class vector this->m_holder.m_size = other_sz; } - template - void priv_move_assign(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x + template + void priv_move_assign(BOOST_RV_REF_BEG vector BOOST_RV_REF_END x , typename dtl::disable_if_or < void - , dtl::is_version - , dtl::is_different + , dtl::is_version::type, 0> + , dtl::is_different::type, allocator_type> >::type * = 0) { //for move assignment, no aliasing (&x != this) is assumed. @@ -2432,12 +2458,12 @@ class vector dtl::move_alloc(this_alloc, x_alloc, dtl::bool_()); } - template - void priv_copy_assign(const vector &x + template + void priv_copy_assign(const vector &x , typename dtl::enable_if_c - < dtl::is_version::value >::type * = 0) + < dtl::is_version::type, 0>::value >::type * = 0) { - if(!dtl::is_same::value && + if(!dtl::is_same::type, allocator_type>::value && this->capacity() < x.size()){ throw_bad_alloc(); } @@ -2449,13 +2475,13 @@ class vector this->m_holder.m_size = other_sz; } - template + template typename dtl::disable_if_or < void - , dtl::is_version - , dtl::is_different + , dtl::is_version::type, 0> + , dtl::is_different::type, allocator_type> >::type - priv_copy_assign(const vector &x) + priv_copy_assign(const vector &x) { allocator_type &this_alloc = this->m_holder.alloc(); const allocator_type &x_alloc = x.m_holder.alloc(); @@ -2510,9 +2536,9 @@ class vector void priv_reserve_no_capacity(size_type, version_0) { throw_bad_alloc(); } - dtl::insert_range_proxy, T*> priv_dummy_empty_proxy() + dtl::insert_range_proxy, T*> priv_dummy_empty_proxy() { - return dtl::insert_range_proxy, T*> + return dtl::insert_range_proxy, T*> (::boost::make_move_iterator((T *)0)); } @@ -2604,14 +2630,14 @@ class vector { BOOST_ASSERT(this->priv_in_range_or_end(p)); return this->priv_forward_range_insert - ( vector_iterator_get_ptr(p), 1, dtl::get_insert_value_proxy(::boost::forward(x))); + ( vector_iterator_get_ptr(p), 1, dtl::get_insert_value_proxy(::boost::forward(x))); } - dtl::insert_copy_proxy priv_single_insert_proxy(const T &x) - { return dtl::insert_copy_proxy (x); } + dtl::insert_copy_proxy priv_single_insert_proxy(const T &x) + { return dtl::insert_copy_proxy (x); } - dtl::insert_move_proxy priv_single_insert_proxy(BOOST_RV_REF(T) x) - { return dtl::insert_move_proxy (x); } + dtl::insert_move_proxy priv_single_insert_proxy(BOOST_RV_REF(T) x) + { return dtl::insert_move_proxy (x); } template void priv_push_back(BOOST_FWD_REF(U) u) @@ -2629,14 +2655,14 @@ class vector } } - BOOST_CONTAINER_FORCEINLINE dtl::insert_n_copies_proxy priv_resize_proxy(const T &x) - { return dtl::insert_n_copies_proxy(x); } + BOOST_CONTAINER_FORCEINLINE dtl::insert_n_copies_proxy priv_resize_proxy(const T &x) + { return dtl::insert_n_copies_proxy(x); } - BOOST_CONTAINER_FORCEINLINE dtl::insert_default_initialized_n_proxy priv_resize_proxy(default_init_t) - { return dtl::insert_default_initialized_n_proxy(); } + BOOST_CONTAINER_FORCEINLINE dtl::insert_default_initialized_n_proxy priv_resize_proxy(default_init_t) + { return dtl::insert_default_initialized_n_proxy(); } - BOOST_CONTAINER_FORCEINLINE dtl::insert_value_initialized_n_proxy priv_resize_proxy(value_init_t) - { return dtl::insert_value_initialized_n_proxy(); } + BOOST_CONTAINER_FORCEINLINE dtl::insert_value_initialized_n_proxy priv_resize_proxy(value_init_t) + { return dtl::insert_value_initialized_n_proxy(); } template void priv_resize(size_type new_size, const U& u) @@ -3384,10 +3410,11 @@ namespace boost { //!has_trivial_destructor_after_move<> == true_type //!specialization for optimizations -template -struct has_trivial_destructor_after_move > +template +struct has_trivial_destructor_after_move > { - typedef typename ::boost::container::allocator_traits::pointer pointer; + typedef typename ::boost::container::allocator_traits + ::type>::pointer pointer; static const bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; };