2121#include < boost/config.hpp>
2222#include < boost/concept_check.hpp>
2323#include < boost/limits.hpp>
24- #include < boost/circular_buffer/allocators .hpp>
24+ #include < boost/core/allocator_access .hpp>
2525#include < boost/core/empty_value.hpp>
2626#include < boost/type_traits/is_stateless.hpp>
2727#include < boost/type_traits/is_integral.hpp>
@@ -99,13 +99,13 @@ private empty_value<Alloc>
9999 typedef circular_buffer<T, Alloc> this_type;
100100
101101 // ! The type of elements stored in the <code>circular_buffer</code>.
102- typedef typename cb_details::allocator_traits< Alloc> ::value_type value_type;
102+ typedef typename Alloc::value_type value_type;
103103
104104 // ! A pointer to an element.
105- typedef typename cb_details::allocator_traits <Alloc>::pointer pointer;
105+ typedef typename allocator_pointer <Alloc>::type pointer;
106106
107107 // ! A const pointer to the element.
108- typedef typename cb_details::allocator_traits <Alloc>::const_pointer const_pointer;
108+ typedef typename allocator_const_pointer <Alloc>::type const_pointer;
109109
110110 // ! A reference to an element.
111111 typedef value_type& reference;
@@ -117,24 +117,24 @@ private empty_value<Alloc>
117117 /* !
118118 (A signed integral type used to represent the distance between two iterators.)
119119 */
120- typedef typename cb_details::allocator_traits <Alloc>::difference_type difference_type;
120+ typedef typename allocator_difference_type <Alloc>::type difference_type;
121121
122122 // ! The size type.
123123 /* !
124124 (An unsigned integral type that can represent any non-negative value of the container's distance type.)
125125 */
126- typedef typename cb_details::allocator_traits <Alloc>::size_type size_type;
126+ typedef typename allocator_size_type <Alloc>::type size_type;
127127
128128 // ! The type of an allocator used in the <code>circular_buffer</code>.
129129 typedef Alloc allocator_type;
130130
131131// Iterators
132132
133133 // ! A const (random access) iterator used to iterate through the <code>circular_buffer</code>.
134- typedef cb_details::iterator< circular_buffer<T, Alloc>, cb_details::const_traits<cb_details::allocator_traits< Alloc> > > const_iterator;
134+ typedef cb_details::iterator< circular_buffer<T, Alloc>, cb_details::const_traits<Alloc> > const_iterator;
135135
136136 // ! A (random access) iterator used to iterate through the <code>circular_buffer</code>.
137- typedef cb_details::iterator< circular_buffer<T, Alloc>, cb_details::nonconst_traits<cb_details::allocator_traits< Alloc> > > iterator;
137+ typedef cb_details::iterator< circular_buffer<T, Alloc>, cb_details::nonconst_traits<Alloc> > iterator;
138138
139139 // ! A const iterator used to iterate backwards through a <code>circular_buffer</code>.
140140 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
@@ -668,7 +668,7 @@ private empty_value<Alloc>
668668 break ;
669669 }
670670 if (is_uninitialized (dest)) {
671- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (dest), boost::move_if_noexcept (*src));
671+ boost::allocator_construct (alloc (), boost::to_address (dest), boost::move_if_noexcept (*src));
672672 ++constructed;
673673 } else {
674674 value_type tmp = boost::move_if_noexcept (*src);
@@ -789,7 +789,7 @@ private empty_value<Alloc>
789789 \sa <code>size()</code>, <code>capacity()</code>, <code>reserve()</code>
790790 */
791791 size_type max_size () const BOOST_NOEXCEPT {
792- return (std::min<size_type>)(cb_details::allocator_traits<Alloc>:: max_size (alloc ()), (std::numeric_limits<difference_type>::max)());
792+ return (std::min<size_type>)(boost::allocator_max_size (alloc ()), (std::numeric_limits<difference_type>::max)());
793793 }
794794
795795 // ! Is the <code>circular_buffer</code> empty?
@@ -1426,7 +1426,7 @@ private empty_value<Alloc>
14261426 increment (m_last);
14271427 m_first = m_last;
14281428 } else {
1429- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (m_last), static_cast <ValT>(item));
1429+ boost::allocator_construct (alloc (), boost::to_address (m_last), static_cast <ValT>(item));
14301430 increment (m_last);
14311431 ++m_size;
14321432 }
@@ -1444,7 +1444,7 @@ private empty_value<Alloc>
14441444 m_last = m_first;
14451445 } else {
14461446 decrement (m_first);
1447- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (m_first), static_cast <ValT>(item));
1447+ boost::allocator_construct (alloc (), boost::to_address (m_first), static_cast <ValT>(item));
14481448 ++m_size;
14491449 }
14501450 } BOOST_CATCH (...) {
@@ -2429,22 +2429,22 @@ private empty_value<Alloc>
24292429 /* ! INTERNAL ONLY */
24302430 void construct_or_replace (bool construct, pointer pos, param_value_type item) {
24312431 if (construct)
2432- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (pos), item);
2432+ boost::allocator_construct (alloc (), boost::to_address (pos), item);
24332433 else
24342434 replace (pos, item);
24352435 }
24362436
24372437 /* ! INTERNAL ONLY */
24382438 void construct_or_replace (bool construct, pointer pos, rvalue_type item) {
24392439 if (construct)
2440- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (pos), boost::move (item));
2440+ boost::allocator_construct (alloc (), boost::to_address (pos), boost::move (item));
24412441 else
24422442 replace (pos, boost::move (item));
24432443 }
24442444
24452445 /* ! INTERNAL ONLY */
24462446 void destroy_item (pointer p) {
2447- cb_details::allocator_traits<Alloc>:: destroy (alloc (), boost::to_address (p));
2447+ boost::allocator_destroy (alloc (), boost::to_address (p));
24482448#if BOOST_CB_ENABLE_DEBUG
24492449 invalidate_iterators (iterator (this , p));
24502450 cb_details::do_fill_uninitialized_memory (p, sizeof (value_type));
@@ -2577,7 +2577,7 @@ private empty_value<Alloc>
25772577 if (buffer_capacity == 0 )
25782578 return ;
25792579 while (first != last && !full ()) {
2580- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (m_last), *first++);
2580+ boost::allocator_construct (alloc (), boost::to_address (m_last), *first++);
25812581 increment (m_last);
25822582 ++m_size;
25832583 }
@@ -2842,7 +2842,7 @@ private empty_value<Alloc>
28422842 pointer p = m_last;
28432843 BOOST_TRY {
28442844 for (; ii < construct; ++ii, increment (p))
2845- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (p), *wrapper ());
2845+ boost::allocator_construct (alloc (), boost::to_address (p), *wrapper ());
28462846 for (;ii < n; ++ii, increment (p))
28472847 replace (p, *wrapper ());
28482848 } BOOST_CATCH (...) {
@@ -2936,7 +2936,7 @@ private empty_value<Alloc>
29362936 for (;ii > construct; --ii, increment (p))
29372937 replace (p, *wrapper ());
29382938 for (; ii > 0 ; --ii, increment (p))
2939- cb_details::allocator_traits<Alloc>:: construct (alloc (), boost::to_address (p), *wrapper ());
2939+ boost::allocator_construct (alloc (), boost::to_address (p), *wrapper ());
29402940 } BOOST_CATCH (...) {
29412941 size_type constructed = ii < construct ? construct - ii : 0 ;
29422942 m_last = add (m_last, constructed);
0 commit comments