@@ -47,7 +47,7 @@ _LIBCPP_PUSH_MACROS
4747_LIBCPP_BEGIN_NAMESPACE_STD
4848
4949// __split_buffer allocates a contiguous chunk of memory and stores objects in the range [__begin_, __end_).
50- // It has uninitialized memory in the ranges [__first_, __begin_) and [__end_, __end_cap_.first() ). That allows
50+ // It has uninitialized memory in the ranges [__first_, __begin_) and [__end_, __cap_ ). That allows
5151// it to grow both in the front and back without having to move the data.
5252
5353template <class _Tp , class _Allocator = allocator<_Tp> >
@@ -78,20 +78,20 @@ public:
7878 pointer __first_;
7979 pointer __begin_;
8080 pointer __end_;
81- _LIBCPP_COMPRESSED_PAIR (pointer, __end_cap_ , allocator_type, __alloc_);
81+ _LIBCPP_COMPRESSED_PAIR (pointer, __cap_ , allocator_type, __alloc_);
8282
8383 __split_buffer (const __split_buffer&) = delete ;
8484 __split_buffer& operator =(const __split_buffer&) = delete ;
8585
8686 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer ()
8787 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
88- : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __end_cap_ (nullptr ) {}
88+ : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __cap_ (nullptr ) {}
8989
9090 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (__alloc_rr& __a)
91- : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __end_cap_ (nullptr ), __alloc_(__a) {}
91+ : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __cap_ (nullptr ), __alloc_(__a) {}
9292
9393 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer (const __alloc_rr& __a)
94- : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __end_cap_ (nullptr ), __alloc_(__a) {}
94+ : __first_(nullptr ), __begin_(nullptr ), __end_(nullptr ), __cap_ (nullptr ), __alloc_(__a) {}
9595
9696 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
9797 __split_buffer (size_type __cap, size_type __start, __alloc_rr& __a);
@@ -123,15 +123,15 @@ public:
123123 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty () const { return __end_ == __begin_; }
124124
125125 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity () const {
126- return static_cast <size_type>(__end_cap_ - __first_);
126+ return static_cast <size_type>(__cap_ - __first_);
127127 }
128128
129129 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare () const {
130130 return static_cast <size_type>(__begin_ - __first_);
131131 }
132132
133133 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare () const {
134- return static_cast <size_type>(__end_cap_ - __end_);
134+ return static_cast <size_type>(__cap_ - __end_);
135135 }
136136
137137 _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front () { return *__begin_; }
@@ -215,14 +215,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __split_buffer<_Tp, _Allocator>::__invariants
215215 return false ;
216216 if (__end_ != nullptr )
217217 return false ;
218- if (__end_cap_ != nullptr )
218+ if (__cap_ != nullptr )
219219 return false ;
220220 } else {
221221 if (__begin_ < __first_)
222222 return false ;
223223 if (__end_ < __begin_)
224224 return false ;
225- if (__end_cap_ < __end_)
225+ if (__cap_ < __end_)
226226 return false ;
227227 }
228228 return true ;
@@ -262,8 +262,8 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void
262262__split_buffer<_Tp, _Allocator>::__construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last) {
263263 __alloc_rr& __a = __alloc_;
264264 for (; __first != __last; ++__first) {
265- if (__end_ == __end_cap_ ) {
266- size_type __old_cap = __end_cap_ - __first_;
265+ if (__end_ == __cap_ ) {
266+ size_type __old_cap = __cap_ - __first_;
267267 size_type __new_cap = std::max<size_type>(2 * __old_cap, 8 );
268268 __split_buffer __buf (__new_cap, 0 , __a);
269269 for (pointer __p = __begin_; __p != __end_; ++__p, (void )++__buf.__end_ )
@@ -320,7 +320,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type
320320template <class _Tp , class _Allocator >
321321_LIBCPP_CONSTEXPR_SINCE_CXX20
322322__split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
323- : __end_cap_ (nullptr ), __alloc_(__a) {
323+ : __cap_ (nullptr ), __alloc_(__a) {
324324 if (__cap == 0 ) {
325325 __first_ = nullptr ;
326326 } else {
@@ -329,7 +329,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
329329 __cap = __allocation.count ;
330330 }
331331 __begin_ = __end_ = __first_ + __start;
332- __end_cap_ = __first_ + __cap;
332+ __cap_ = __first_ + __cap;
333333}
334334
335335template <class _Tp , class _Allocator >
@@ -345,32 +345,32 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>::__split_buffer(__
345345 : __first_(std::move(__c.__first_)),
346346 __begin_(std::move(__c.__begin_)),
347347 __end_(std::move(__c.__end_)),
348- __end_cap_ (std::move(__c.__end_cap_ )),
348+ __cap_ (std::move(__c.__cap_ )),
349349 __alloc_(std::move(__c.__alloc_)) {
350- __c.__first_ = nullptr ;
351- __c.__begin_ = nullptr ;
352- __c.__end_ = nullptr ;
353- __c.__end_cap_ = nullptr ;
350+ __c.__first_ = nullptr ;
351+ __c.__begin_ = nullptr ;
352+ __c.__end_ = nullptr ;
353+ __c.__cap_ = nullptr ;
354354}
355355
356356template <class _Tp , class _Allocator >
357357_LIBCPP_CONSTEXPR_SINCE_CXX20
358358__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
359- : __end_cap_ (nullptr ), __alloc_(__a) {
359+ : __cap_ (nullptr ), __alloc_(__a) {
360360 if (__a == __c.__alloc_ ) {
361- __first_ = __c.__first_ ;
362- __begin_ = __c.__begin_ ;
363- __end_ = __c.__end_ ;
364- __end_cap_ = __c.__end_cap_ ;
365- __c.__first_ = nullptr ;
366- __c.__begin_ = nullptr ;
367- __c.__end_ = nullptr ;
368- __c.__end_cap_ = nullptr ;
361+ __first_ = __c.__first_ ;
362+ __begin_ = __c.__begin_ ;
363+ __end_ = __c.__end_ ;
364+ __cap_ = __c.__cap_ ;
365+ __c.__first_ = nullptr ;
366+ __c.__begin_ = nullptr ;
367+ __c.__end_ = nullptr ;
368+ __c.__cap_ = nullptr ;
369369 } else {
370370 auto __allocation = std::__allocate_at_least (__alloc_, __c.size ());
371371 __first_ = __allocation.ptr ;
372372 __begin_ = __end_ = __first_;
373- __end_cap_ = __first_ + __allocation.count ;
373+ __cap_ = __first_ + __allocation.count ;
374374 typedef move_iterator<iterator> _Ip;
375375 __construct_at_end (_Ip (__c.begin ()), _Ip (__c.end ()));
376376 }
@@ -384,12 +384,12 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
384384 !__alloc_traits::propagate_on_container_move_assignment::value) {
385385 clear ();
386386 shrink_to_fit ();
387- __first_ = __c.__first_ ;
388- __begin_ = __c.__begin_ ;
389- __end_ = __c.__end_ ;
390- __end_cap_ = __c.__end_cap_ ;
387+ __first_ = __c.__first_ ;
388+ __begin_ = __c.__begin_ ;
389+ __end_ = __c.__end_ ;
390+ __cap_ = __c.__cap_ ;
391391 __move_assign_alloc (__c, integral_constant<bool , __alloc_traits::propagate_on_container_move_assignment::value>());
392- __c.__first_ = __c.__begin_ = __c.__end_ = __c.__end_cap_ = nullptr ;
392+ __c.__first_ = __c.__begin_ = __c.__end_ = __c.__cap_ = nullptr ;
393393 return *this ;
394394}
395395
@@ -399,7 +399,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::swap(__split
399399 std::swap (__first_, __x.__first_ );
400400 std::swap (__begin_, __x.__begin_ );
401401 std::swap (__end_, __x.__end_ );
402- std::swap (__end_cap_ , __x.__end_cap_ );
402+ std::swap (__cap_ , __x.__cap_ );
403403 std::__swap_allocator (__alloc_, __x.__alloc_ );
404404}
405405
@@ -415,7 +415,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::shrink_to_fi
415415 std::swap (__first_, __t .__first_ );
416416 std::swap (__begin_, __t .__begin_ );
417417 std::swap (__end_, __t .__end_ );
418- std::swap (__end_cap_ , __t .__end_cap_ );
418+ std::swap (__cap_ , __t .__cap_ );
419419#if _LIBCPP_HAS_EXCEPTIONS
420420 } catch (...) {
421421 }
@@ -427,19 +427,19 @@ template <class _Tp, class _Allocator>
427427template <class ... _Args>
428428_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_front (_Args&&... __args) {
429429 if (__begin_ == __first_) {
430- if (__end_ < __end_cap_ ) {
431- difference_type __d = __end_cap_ - __end_;
430+ if (__end_ < __cap_ ) {
431+ difference_type __d = __cap_ - __end_;
432432 __d = (__d + 1 ) / 2 ;
433433 __begin_ = std::move_backward (__begin_, __end_, __end_ + __d);
434434 __end_ += __d;
435435 } else {
436- size_type __c = std::max<size_type>(2 * static_cast <size_t >(__end_cap_ - __first_), 1 );
436+ size_type __c = std::max<size_type>(2 * static_cast <size_t >(__cap_ - __first_), 1 );
437437 __split_buffer<value_type, __alloc_rr&> __t (__c, (__c + 3 ) / 4 , __alloc_);
438438 __t .__construct_at_end (move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_));
439439 std::swap (__first_, __t .__first_ );
440440 std::swap (__begin_, __t .__begin_ );
441441 std::swap (__end_, __t .__end_ );
442- std::swap (__end_cap_ , __t .__end_cap_ );
442+ std::swap (__cap_ , __t .__cap_ );
443443 }
444444 }
445445 __alloc_traits::construct (__alloc_, std::__to_address (__begin_ - 1 ), std::forward<_Args>(__args)...);
@@ -449,20 +449,20 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_fron
449449template <class _Tp , class _Allocator >
450450template <class ... _Args>
451451_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_back (_Args&&... __args) {
452- if (__end_ == __end_cap_ ) {
452+ if (__end_ == __cap_ ) {
453453 if (__begin_ > __first_) {
454454 difference_type __d = __begin_ - __first_;
455455 __d = (__d + 1 ) / 2 ;
456456 __end_ = std::move (__begin_, __end_, __begin_ - __d);
457457 __begin_ -= __d;
458458 } else {
459- size_type __c = std::max<size_type>(2 * static_cast <size_t >(__end_cap_ - __first_), 1 );
459+ size_type __c = std::max<size_type>(2 * static_cast <size_t >(__cap_ - __first_), 1 );
460460 __split_buffer<value_type, __alloc_rr&> __t (__c, __c / 4 , __alloc_);
461461 __t .__construct_at_end (move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_));
462462 std::swap (__first_, __t .__first_ );
463463 std::swap (__begin_, __t .__begin_ );
464464 std::swap (__end_, __t .__end_ );
465- std::swap (__end_cap_ , __t .__end_cap_ );
465+ std::swap (__cap_ , __t .__cap_ );
466466 }
467467 }
468468 __alloc_traits::construct (__alloc_, std::__to_address (__end_), std::forward<_Args>(__args)...);
0 commit comments