@@ -941,7 +941,7 @@ private:
941
941
__set_short_size (__size);
942
942
} else {
943
943
auto __capacity = __recommend (__size) + 1 ;
944
- auto __allocation = __alloc_traits::allocate (__alloc () , __capacity);
944
+ auto __allocation = __alloc_traits::allocate (__alloc_ , __capacity);
945
945
__begin_lifetime (__allocation, __capacity);
946
946
__set_long_cap (__capacity);
947
947
__set_long_pointer (__allocation);
@@ -1006,7 +1006,7 @@ public:
1006
1006
}
1007
1007
1008
1008
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS basic_string (const basic_string& __str)
1009
- : __alloc_(__alloc_traits::select_on_container_copy_construction(__str.__alloc() )) {
1009
+ : __alloc_(__alloc_traits::select_on_container_copy_construction(__str.__alloc_ )) {
1010
1010
if (!__str.__is_long ()) {
1011
1011
__rep_ = __str.__rep_ ;
1012
1012
__annotate_new (__get_short_size ());
@@ -1048,7 +1048,7 @@ public:
1048
1048
1049
1049
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string (basic_string&& __str, const allocator_type& __a)
1050
1050
: __alloc_(__a) {
1051
- if (__str.__is_long () && __a != __str.__alloc () ) // copy, not move
1051
+ if (__str.__is_long () && __a != __str.__alloc_ ) // copy, not move
1052
1052
__init (std::__to_address (__str.__get_long_pointer ()), __str.__get_long_size ());
1053
1053
else {
1054
1054
if (__libcpp_is_constant_evaluated ())
@@ -1107,7 +1107,7 @@ public:
1107
1107
__throw_out_of_range ();
1108
1108
1109
1109
auto __len = std::min<size_type>(__n, __str.size () - __pos);
1110
- if (__alloc_traits::is_always_equal::value || __alloc == __str.__alloc () ) {
1110
+ if (__alloc_traits::is_always_equal::value || __alloc == __str.__alloc_ ) {
1111
1111
__move_assign (std::move (__str), __pos, __len);
1112
1112
} else {
1113
1113
// Perform a copy because the allocators are not compatible.
@@ -1212,7 +1212,7 @@ public:
1212
1212
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 ~basic_string () {
1213
1213
__annotate_delete ();
1214
1214
if (__is_long ())
1215
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), __get_long_cap ());
1215
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), __get_long_cap ());
1216
1216
}
1217
1217
1218
1218
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view () const _NOEXCEPT {
@@ -1289,7 +1289,7 @@ public:
1289
1289
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type length () const _NOEXCEPT { return size (); }
1290
1290
1291
1291
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type max_size () const _NOEXCEPT {
1292
- size_type __m = __alloc_traits::max_size (__alloc () );
1292
+ size_type __m = __alloc_traits::max_size (__alloc_ );
1293
1293
if (__m <= std::numeric_limits<size_type>::max () / 2 ) {
1294
1294
return __m - __alignment;
1295
1295
} else {
@@ -1409,7 +1409,7 @@ public:
1409
1409
template <class _InputIterator , __enable_if_t <__has_exactly_input_iterator_category<_InputIterator>::value, int > = 0 >
1410
1410
_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1411
1411
append (_InputIterator __first, _InputIterator __last) {
1412
- const basic_string __temp (__first, __last, __alloc () );
1412
+ const basic_string __temp (__first, __last, __alloc_ );
1413
1413
append (__temp.data (), __temp.size ());
1414
1414
return *this ;
1415
1415
}
@@ -1465,7 +1465,7 @@ public:
1465
1465
#if _LIBCPP_STD_VER >= 20
1466
1466
_LIBCPP_HIDE_FROM_ABI constexpr void __move_assign (basic_string&& __str, size_type __pos, size_type __len) {
1467
1467
// Pilfer the allocation from __str.
1468
- _LIBCPP_ASSERT_INTERNAL (__alloc () == __str.__alloc () , " __move_assign called with wrong allocator" );
1468
+ _LIBCPP_ASSERT_INTERNAL (__alloc_ == __str.__alloc_ , " __move_assign called with wrong allocator" );
1469
1469
size_type __old_sz = __str.size ();
1470
1470
if (!__str.__is_long ())
1471
1471
__str.__annotate_delete ();
@@ -1571,7 +1571,7 @@ public:
1571
1571
return __insert_with_size (__position, ranges::begin (__range), ranges::end (__range), __n);
1572
1572
1573
1573
} else {
1574
- basic_string __temp (from_range, std::forward<_Range>(__range), __alloc () );
1574
+ basic_string __temp (from_range, std::forward<_Range>(__range), __alloc_ );
1575
1575
return insert (__position, __temp.data (), __temp.data () + __temp.size ());
1576
1576
}
1577
1577
}
@@ -1666,7 +1666,7 @@ public:
1666
1666
template <_ContainerCompatibleRange<_CharT> _Range>
1667
1667
_LIBCPP_HIDE_FROM_ABI constexpr basic_string&
1668
1668
replace_with_range (const_iterator __i1, const_iterator __i2, _Range&& __range) {
1669
- basic_string __temp (from_range, std::forward<_Range>(__range), __alloc () );
1669
+ basic_string __temp (from_range, std::forward<_Range>(__range), __alloc_ );
1670
1670
return replace (__i1, __i2, __temp);
1671
1671
}
1672
1672
#endif
@@ -1713,7 +1713,7 @@ public:
1713
1713
#endif
1714
1714
1715
1715
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator_type get_allocator () const _NOEXCEPT {
1716
- return __alloc () ;
1716
+ return __alloc_ ;
1717
1717
}
1718
1718
1719
1719
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
@@ -1949,9 +1949,6 @@ private:
1949
1949
_LIBCPP_CONSTEXPR_SINCE_CXX20 iterator
1950
1950
__insert_with_size (const_iterator __pos, _Iterator __first, _Sentinel __last, size_type __n);
1951
1951
1952
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 allocator_type& __alloc () _NOEXCEPT { return __alloc_; }
1953
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const allocator_type& __alloc () const _NOEXCEPT { return __alloc_; }
1954
-
1955
1952
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS void
1956
1953
__set_short_size (size_type __s) _NOEXCEPT {
1957
1954
_LIBCPP_ASSERT_INTERNAL (__s < __min_cap, " __s should never be greater than or equal to the short string capacity" );
@@ -2152,20 +2149,20 @@ private:
2152
2149
}
2153
2150
2154
2151
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __copy_assign_alloc (const basic_string& __str, true_type) {
2155
- if (__alloc () == __str.__alloc () )
2156
- __alloc () = __str.__alloc () ;
2152
+ if (__alloc_ == __str.__alloc_ )
2153
+ __alloc_ = __str.__alloc_ ;
2157
2154
else {
2158
2155
if (!__str.__is_long ()) {
2159
2156
__clear_and_shrink ();
2160
- __alloc () = __str.__alloc () ;
2157
+ __alloc_ = __str.__alloc_ ;
2161
2158
} else {
2162
2159
__annotate_delete ();
2163
- allocator_type __a = __str.__alloc () ;
2160
+ allocator_type __a = __str.__alloc_ ;
2164
2161
auto __allocation = std::__allocate_at_least (__a, __str.__get_long_cap ());
2165
2162
__begin_lifetime (__allocation.ptr , __allocation.count );
2166
2163
if (__is_long ())
2167
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), __get_long_cap ());
2168
- __alloc () = std::move (__a);
2164
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), __get_long_cap ());
2165
+ __alloc_ = std::move (__a);
2169
2166
__set_long_pointer (__allocation.ptr );
2170
2167
__set_long_cap (__allocation.count );
2171
2168
__set_long_size (__str.size ());
@@ -2198,7 +2195,7 @@ private:
2198
2195
2199
2196
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign_alloc (basic_string& __c, true_type)
2200
2197
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
2201
- __alloc () = std::move (__c.__alloc () );
2198
+ __alloc_ = std::move (__c.__alloc_ );
2202
2199
}
2203
2200
2204
2201
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign_alloc (basic_string&, false_type) _NOEXCEPT {}
@@ -2321,7 +2318,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
2321
2318
__set_short_size (__sz);
2322
2319
__p = __get_short_pointer ();
2323
2320
} else {
2324
- auto __allocation = std::__allocate_at_least (__alloc () , __recommend (__reserve) + 1 );
2321
+ auto __allocation = std::__allocate_at_least (__alloc_ , __recommend (__reserve) + 1 );
2325
2322
__p = __allocation.ptr ;
2326
2323
__begin_lifetime (__p, __allocation.count );
2327
2324
__set_long_pointer (__p);
@@ -2345,7 +2342,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
2345
2342
__set_short_size (__sz);
2346
2343
__p = __get_short_pointer ();
2347
2344
} else {
2348
- auto __allocation = std::__allocate_at_least (__alloc () , __recommend (__sz) + 1 );
2345
+ auto __allocation = std::__allocate_at_least (__alloc_ , __recommend (__sz) + 1 );
2349
2346
__p = __allocation.ptr ;
2350
2347
__begin_lifetime (__p, __allocation.count );
2351
2348
__set_long_pointer (__p);
@@ -2370,7 +2367,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(const value
2370
2367
} else {
2371
2368
if (__sz > max_size ())
2372
2369
__throw_length_error ();
2373
- auto __allocation = std::__allocate_at_least (__alloc () , __recommend (__sz) + 1 );
2370
+ auto __allocation = std::__allocate_at_least (__alloc_ , __recommend (__sz) + 1 );
2374
2371
__p = __allocation.ptr ;
2375
2372
__begin_lifetime (__p, __allocation.count );
2376
2373
__set_long_pointer (__p);
@@ -2393,7 +2390,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
2393
2390
__set_short_size (__n);
2394
2391
__p = __get_short_pointer ();
2395
2392
} else {
2396
- auto __allocation = std::__allocate_at_least (__alloc () , __recommend (__n) + 1 );
2393
+ auto __allocation = std::__allocate_at_least (__alloc_ , __recommend (__n) + 1 );
2397
2394
__p = __allocation.ptr ;
2398
2395
__begin_lifetime (__p, __allocation.count );
2399
2396
__set_long_pointer (__p);
@@ -2428,7 +2425,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init_with_sentinel(_InputIterator _
2428
2425
} catch (...) {
2429
2426
__annotate_delete ();
2430
2427
if (__is_long ())
2431
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), __get_long_cap ());
2428
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), __get_long_cap ());
2432
2429
throw ;
2433
2430
}
2434
2431
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
@@ -2458,7 +2455,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init_with_size(_InputIterator __fir
2458
2455
__p = __get_short_pointer ();
2459
2456
2460
2457
} else {
2461
- auto __allocation = std::__allocate_at_least (__alloc () , __recommend (__sz) + 1 );
2458
+ auto __allocation = std::__allocate_at_least (__alloc_ , __recommend (__sz) + 1 );
2462
2459
__p = __allocation.ptr ;
2463
2460
__begin_lifetime (__p, __allocation.count );
2464
2461
__set_long_pointer (__p);
@@ -2474,7 +2471,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init_with_size(_InputIterator __fir
2474
2471
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
2475
2472
} catch (...) {
2476
2473
if (__is_long ())
2477
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), __get_long_cap ());
2474
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), __get_long_cap ());
2478
2475
throw ;
2479
2476
}
2480
2477
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
@@ -2497,7 +2494,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
2497
2494
size_type __cap =
2498
2495
__old_cap < __ms / 2 - __alignment ? __recommend (std::max (__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1 ;
2499
2496
__annotate_delete ();
2500
- auto __allocation = std::__allocate_at_least (__alloc () , __cap + 1 );
2497
+ auto __allocation = std::__allocate_at_least (__alloc_ , __cap + 1 );
2501
2498
pointer __p = __allocation.ptr ;
2502
2499
__begin_lifetime (__p, __allocation.count );
2503
2500
if (__n_copy != 0 )
@@ -2509,7 +2506,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__
2509
2506
traits_type::copy (
2510
2507
std::__to_address (__p) + __n_copy + __n_add, std::__to_address (__old_p) + __n_copy + __n_del, __sec_cp_sz);
2511
2508
if (__old_cap + 1 != __min_cap)
2512
- __alloc_traits::deallocate (__alloc () , __old_p, __old_cap + 1 );
2509
+ __alloc_traits::deallocate (__alloc_ , __old_p, __old_cap + 1 );
2513
2510
__set_long_pointer (__p);
2514
2511
__set_long_cap (__allocation.count );
2515
2512
__old_sz = __n_copy + __n_add + __sec_cp_sz;
@@ -2540,7 +2537,7 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
2540
2537
size_type __cap =
2541
2538
__old_cap < __ms / 2 - __alignment ? __recommend (std::max (__old_cap + __delta_cap, 2 * __old_cap)) : __ms - 1 ;
2542
2539
__annotate_delete ();
2543
- auto __allocation = std::__allocate_at_least (__alloc () , __cap + 1 );
2540
+ auto __allocation = std::__allocate_at_least (__alloc_ , __cap + 1 );
2544
2541
pointer __p = __allocation.ptr ;
2545
2542
__begin_lifetime (__p, __allocation.count );
2546
2543
if (__n_copy != 0 )
@@ -2550,7 +2547,7 @@ _LIBCPP_DEPRECATED_("use __grow_by_without_replace") basic_string<_CharT, _Trait
2550
2547
traits_type::copy (
2551
2548
std::__to_address (__p) + __n_copy + __n_add, std::__to_address (__old_p) + __n_copy + __n_del, __sec_cp_sz);
2552
2549
if (__old_cap + 1 != __min_cap)
2553
- __alloc_traits::deallocate (__alloc () , __old_p, __old_cap + 1 );
2550
+ __alloc_traits::deallocate (__alloc_ , __old_p, __old_cap + 1 );
2554
2551
__set_long_pointer (__p);
2555
2552
__set_long_cap (__allocation.count );
2556
2553
}
@@ -2685,7 +2682,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
2685
2682
template <class _CharT , class _Traits , class _Allocator >
2686
2683
inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocator>::__move_assign (
2687
2684
basic_string& __str, false_type) noexcept (__alloc_traits::is_always_equal::value) {
2688
- if (__alloc () != __str.__alloc () )
2685
+ if (__alloc_ != __str.__alloc_ )
2689
2686
assign (__str);
2690
2687
else
2691
2688
__move_assign (__str, true_type ());
@@ -2702,7 +2699,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
2702
2699
{
2703
2700
__annotate_delete ();
2704
2701
if (__is_long ()) {
2705
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), __get_long_cap ());
2702
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), __get_long_cap ());
2706
2703
# if _LIBCPP_STD_VER <= 14
2707
2704
if (!is_nothrow_move_assignable<allocator_type>::value) {
2708
2705
__set_short_size (0 );
@@ -2752,7 +2749,7 @@ template <class _CharT, class _Traits, class _Allocator>
2752
2749
template <class _InputIterator , class _Sentinel >
2753
2750
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2754
2751
basic_string<_CharT, _Traits, _Allocator>::__assign_with_sentinel (_InputIterator __first, _Sentinel __last) {
2755
- const basic_string __temp (__init_with_sentinel_tag (), std::move (__first), std::move (__last), __alloc () );
2752
+ const basic_string __temp (__init_with_sentinel_tag (), std::move (__first), std::move (__last), __alloc_ );
2756
2753
assign (__temp.data (), __temp.size ());
2757
2754
}
2758
2755
@@ -2940,7 +2937,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(_ForwardIterator __first, _For
2940
2937
traits_type::assign (*__end, value_type ());
2941
2938
__set_size (__sz + __n);
2942
2939
} else {
2943
- const basic_string __temp (__first, __last, __alloc () );
2940
+ const basic_string __temp (__first, __last, __alloc_ );
2944
2941
append (__temp.data (), __temp.size ());
2945
2942
}
2946
2943
}
@@ -3038,7 +3035,7 @@ template <class _CharT, class _Traits, class _Allocator>
3038
3035
template <class _InputIterator , __enable_if_t <__has_exactly_input_iterator_category<_InputIterator>::value, int > >
3039
3036
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename basic_string<_CharT, _Traits, _Allocator>::iterator
3040
3037
basic_string<_CharT, _Traits, _Allocator>::insert (const_iterator __pos, _InputIterator __first, _InputIterator __last) {
3041
- const basic_string __temp (__first, __last, __alloc () );
3038
+ const basic_string __temp (__first, __last, __alloc_ );
3042
3039
return insert (__pos, __temp.data (), __temp.data () + __temp.size ());
3043
3040
}
3044
3041
@@ -3063,7 +3060,7 @@ basic_string<_CharT, _Traits, _Allocator>::__insert_with_size(
3063
3060
if (__string_is_trivial_iterator<_Iterator>::value && !__addr_in_range (*__first)) {
3064
3061
return __insert_from_safe_copy (__n, __ip, __first, __last);
3065
3062
} else {
3066
- const basic_string __temp (__init_with_sentinel_tag (), __first, __last, __alloc () );
3063
+ const basic_string __temp (__init_with_sentinel_tag (), __first, __last, __alloc_ );
3067
3064
return __insert_from_safe_copy (__n, __ip, __temp.begin (), __temp.end ());
3068
3065
}
3069
3066
}
@@ -3200,7 +3197,7 @@ template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_Inp
3200
3197
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string<_CharT, _Traits, _Allocator>&
3201
3198
basic_string<_CharT, _Traits, _Allocator>::replace (
3202
3199
const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2) {
3203
- const basic_string __temp (__j1, __j2, __alloc () );
3200
+ const basic_string __temp (__j1, __j2, __alloc_ );
3204
3201
return replace (__i1, __i2, __temp);
3205
3202
}
3206
3203
@@ -3372,7 +3369,7 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
3372
3369
if (__target_capacity > __cap) {
3373
3370
// Extend
3374
3371
// - called from reserve should propagate the exception thrown.
3375
- auto __allocation = std::__allocate_at_least (__alloc () , __target_capacity + 1 );
3372
+ auto __allocation = std::__allocate_at_least (__alloc_ , __target_capacity + 1 );
3376
3373
__new_data = __allocation.ptr ;
3377
3374
__target_capacity = __allocation.count - 1 ;
3378
3375
} else {
@@ -3382,13 +3379,13 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
3382
3379
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
3383
3380
try {
3384
3381
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
3385
- auto __allocation = std::__allocate_at_least (__alloc () , __target_capacity + 1 );
3382
+ auto __allocation = std::__allocate_at_least (__alloc_ , __target_capacity + 1 );
3386
3383
3387
3384
// The Standard mandates shrink_to_fit() does not increase the capacity.
3388
3385
// With equal capacity keep the existing buffer. This avoids extra work
3389
3386
// due to swapping the elements.
3390
3387
if (__allocation.count - 1 > __target_capacity) {
3391
- __alloc_traits::deallocate (__alloc () , __allocation.ptr , __allocation.count );
3388
+ __alloc_traits::deallocate (__alloc_ , __allocation.ptr , __allocation.count );
3392
3389
__annotate_new (__sz); // Undoes the __annotate_delete()
3393
3390
return ;
3394
3391
}
@@ -3407,7 +3404,7 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
3407
3404
}
3408
3405
traits_type::copy (std::__to_address (__new_data), std::__to_address (__p), size () + 1 );
3409
3406
if (__was_long)
3410
- __alloc_traits::deallocate (__alloc () , __p, __cap + 1 );
3407
+ __alloc_traits::deallocate (__alloc_ , __p, __cap + 1 );
3411
3408
if (__now_long) {
3412
3409
__set_long_cap (__target_capacity + 1 );
3413
3410
__set_long_size (__sz);
@@ -3454,14 +3451,14 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
3454
3451
{
3455
3452
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR (
3456
3453
__alloc_traits::propagate_on_container_swap::value || __alloc_traits::is_always_equal::value ||
3457
- __alloc () == __str.__alloc () ,
3454
+ __alloc_ == __str.__alloc_ ,
3458
3455
" swapping non-equal allocators" );
3459
3456
if (!__is_long ())
3460
3457
__annotate_delete ();
3461
3458
if (this != std::addressof (__str) && !__str.__is_long ())
3462
3459
__str.__annotate_delete ();
3463
3460
std::swap (__rep_, __str.__rep_ );
3464
- std::__swap_allocator (__alloc () , __str.__alloc () );
3461
+ std::__swap_allocator (__alloc_ , __str.__alloc_ );
3465
3462
if (!__is_long ())
3466
3463
__annotate_new (__get_short_size ());
3467
3464
if (this != std::addressof (__str) && !__str.__is_long ())
@@ -3814,7 +3811,7 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
3814
3811
clear ();
3815
3812
if (__is_long ()) {
3816
3813
__annotate_delete ();
3817
- __alloc_traits::deallocate (__alloc () , __get_long_pointer (), capacity () + 1 );
3814
+ __alloc_traits::deallocate (__alloc_ , __get_long_pointer (), capacity () + 1 );
3818
3815
__rep_ = __rep ();
3819
3816
}
3820
3817
}
0 commit comments