3333#include < __type_traits/is_swappable.h>
3434#include < __type_traits/is_trivially_destructible.h>
3535#include < __type_traits/is_trivially_relocatable.h>
36- #include < __type_traits/remove_reference.h>
3736#include < __utility/forward.h>
3837#include < __utility/move.h>
3938
@@ -54,8 +53,7 @@ class __split_buffer_pointer_layout {
5453protected:
5554 using value_type = _Tp;
5655 using allocator_type = _Allocator;
57- using __alloc_rr _LIBCPP_NODEBUG = __libcpp_remove_reference_t <allocator_type>;
58- using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<__alloc_rr>;
56+ using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
5957 using reference = value_type&;
6058 using const_reference = const value_type&;
6159 using size_type = typename __alloc_traits::size_type;
@@ -159,9 +157,9 @@ public:
159157 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back () const _NOEXCEPT { return *(__end_ - 1 ); }
160158
161159 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator (
162- __split_buffer_pointer_layout<__split_buffer<value_type, __alloc_rr& , __split_buffer_pointer_layout>,
160+ __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type , __split_buffer_pointer_layout>,
163161 value_type,
164- __alloc_rr& >& __other) _NOEXCEPT {
162+ allocator_type >& __other) _NOEXCEPT {
165163 std::swap (__front_cap_, __other.__front_cap_ );
166164 std::swap (__begin_, __other.__begin_ );
167165 std::swap (__back_cap_, __other.__back_cap_ );
@@ -207,8 +205,7 @@ class __split_buffer_size_layout {
207205protected:
208206 using value_type = _Tp;
209207 using allocator_type = _Allocator;
210- using __alloc_rr _LIBCPP_NODEBUG = __libcpp_remove_reference_t <allocator_type>;
211- using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<__alloc_rr>;
208+ using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<allocator_type>;
212209 using reference = value_type&;
213210 using const_reference = const value_type&;
214211 using size_type = typename __alloc_traits::size_type;
@@ -316,9 +313,9 @@ public:
316313 }
317314
318315 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator (
319- __split_buffer_pointer_layout<__split_buffer<value_type, __alloc_rr& , __split_buffer_pointer_layout>,
316+ __split_buffer_pointer_layout<__split_buffer<value_type, allocator_type , __split_buffer_pointer_layout>,
320317 value_type,
321- __alloc_rr& >& __other) _NOEXCEPT {
318+ allocator_type >& __other) _NOEXCEPT {
322319 std::swap (__front_cap_, __other.__front_cap_ );
323320 std::swap (__begin_, __other.__begin_ );
324321 std::swap (__cap_, __other.__cap_ );
@@ -386,8 +383,7 @@ private:
386383// protected:
387384// using value_type = _Tp;
388385// using allocator_type = _Allocator;
389- // using __alloc_rr = __libcpp_remove_reference_t<allocator_type>;
390- // using __alloc_traits = allocator_traits<__alloc_rr>;
386+ // using __alloc_traits = allocator_traits<allocator_type>;
391387// using reference = value_type&;
392388// using const_reference = const value_type&;
393389// using size_type = typename __alloc_traits::size_type;
@@ -462,7 +458,6 @@ public:
462458 using __base_type::__set_sentinel;
463459 using __base_type::__set_valid_range;
464460
465- using typename __base_type::__alloc_rr;
466461 using typename __base_type::__alloc_traits;
467462 using typename __base_type::allocator_type;
468463 using typename __base_type::const_iterator;
@@ -489,18 +484,18 @@ public:
489484
490485 _LIBCPP_HIDE_FROM_ABI __split_buffer () = default;
491486
492- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (__alloc_rr & __a) : __base_type(__a) {}
487+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (allocator_type & __a) : __base_type(__a) {}
493488
494- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (const __alloc_rr & __a)
489+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (const allocator_type & __a)
495490 : __base_type(__a) {}
496491
497492 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
498- __split_buffer (size_type __cap, size_type __start, __alloc_rr & __a);
493+ __split_buffer (size_type __cap, size_type __start, allocator_type & __a);
499494
500495 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer (__split_buffer&& __c)
501496 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
502497
503- _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer (__split_buffer&& __c, const __alloc_rr & __a);
498+ _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer (__split_buffer&& __c, const allocator_type & __a);
504499
505500 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator =(__split_buffer&& __c)
506501 _NOEXCEPT_ ((__alloc_traits::propagate_on_container_move_assignment::value &&
@@ -560,7 +555,7 @@ public:
560555 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end (pointer __new_last, true_type) _NOEXCEPT;
561556
562557 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap (__split_buffer& __x)
563- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr >);
558+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type >);
564559
565560 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants () const {
566561 if (__front_cap () == nullptr ) {
@@ -589,7 +584,7 @@ public:
589584 }
590585
591586 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
592- __swap_without_allocator (__split_buffer<value_type, __alloc_rr& , _Layout>& __other) _NOEXCEPT {
587+ __swap_without_allocator (__split_buffer<value_type, allocator_type , _Layout>& __other) _NOEXCEPT {
593588 __base_type::__swap_without_allocator (__other);
594589 }
595590
@@ -653,7 +648,7 @@ template <class _Tp, class _Allocator, template <class, class, class> class _Lay
653648template <class _Iterator , class _Sentinel >
654649_LIBCPP_CONSTEXPR_SINCE_CXX20 void
655650__split_buffer<_Tp, _Allocator, _Layout>::__construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last) {
656- __alloc_rr & __a = __get_allocator ();
651+ allocator_type & __a = __get_allocator ();
657652 for (; __first != __last; ++__first) {
658653 if (__back_spare () == 0 ) {
659654 size_type __old_cap = capacity ();
@@ -718,7 +713,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::__destruct_at_end(pointer __new_last,
718713
719714template <class _Tp , class _Allocator , template <class , class , class > class _Layout >
720715_LIBCPP_CONSTEXPR_SINCE_CXX20
721- __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(size_type __cap, size_type __start, __alloc_rr & __a)
716+ __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(size_type __cap, size_type __start, allocator_type & __a)
722717 : __base_type(__a) {
723718 _LIBCPP_ASSERT_INTERNAL (__cap >= __start, " can't have a start point outside the capacity" );
724719 if (__cap > 0 ) {
@@ -748,7 +743,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_
748743
749744template <class _Tp , class _Allocator , template <class , class , class > class _Layout >
750745_LIBCPP_CONSTEXPR_SINCE_CXX20
751- __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, const __alloc_rr & __a)
746+ __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, const allocator_type & __a)
752747 : __base_type(__a) {
753748 if (__a == __c.__get_allocator ()) {
754749 __set_data (__c.__front_cap ());
@@ -781,7 +776,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
781776
782777template <class _Tp , class _Allocator , template <class , class , class > class _Layout >
783778_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x)
784- _NOEXCEPT_ (!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr >) {
779+ _NOEXCEPT_ (!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type >) {
785780 __base_type::swap (__x);
786781}
787782
@@ -791,7 +786,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::shr
791786#if _LIBCPP_HAS_EXCEPTIONS
792787 try {
793788#endif // _LIBCPP_HAS_EXCEPTIONS
794- __split_buffer<value_type, __alloc_rr& , _Layout> __t (size (), 0 , __get_allocator ());
789+ __split_buffer<value_type, allocator_type , _Layout> __t (size (), 0 , __get_allocator ());
795790 if (__t .capacity () < capacity ()) {
796791 __t .__construct_at_end (move_iterator<pointer>(begin ()), move_iterator<pointer>(end ()));
797792 __t .__set_sentinel (size ());
@@ -818,7 +813,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
818813 __set_valid_range (std::move_backward (begin (), __end, __new_end), __new_end);
819814 } else {
820815 size_type __c = std::max<size_type>(2 * capacity (), 1 );
821- __split_buffer<value_type, __alloc_rr& , _Layout> __t (__c, (__c + 3 ) / 4 , __get_allocator ());
816+ __split_buffer<value_type, allocator_type , _Layout> __t (__c, (__c + 3 ) / 4 , __get_allocator ());
822817 __t .__construct_at_end (move_iterator<pointer>(begin ()), move_iterator<pointer>(__end));
823818 __base_type::__swap_without_allocator (__t );
824819 }
@@ -840,7 +835,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
840835 __set_valid_range (begin () - __d, __end);
841836 } else {
842837 size_type __c = std::max<size_type>(2 * capacity (), 1 );
843- __split_buffer<value_type, __alloc_rr& , _Layout> __t (__c, __c / 4 , __get_allocator ());
838+ __split_buffer<value_type, allocator_type , _Layout> __t (__c, __c / 4 , __get_allocator ());
844839 __t .__construct_at_end (move_iterator<pointer>(begin ()), move_iterator<pointer>(__end));
845840 __base_type::__swap_without_allocator (__t );
846841 }
0 commit comments