@@ -700,18 +700,18 @@ __concatenate_strings(const _Allocator& __alloc,
700
700
__type_identity_t <basic_string_view<_CharT, _Traits> > __str2);
701
701
702
702
template <class _Iter >
703
- struct __string_is_trivial_iterator : public false_type {} ;
703
+ inline const bool __string_is_trivial_iterator_v = false ;
704
704
705
705
template <class _Tp >
706
- struct __string_is_trivial_iterator <_Tp*> : public is_arithmetic<_Tp> {} ;
706
+ inline const bool __string_is_trivial_iterator_v <_Tp*> = is_arithmetic<_Tp>::value ;
707
707
708
708
template <class _Iter >
709
- struct __string_is_trivial_iterator <__wrap_iter<_Iter> > : public __string_is_trivial_iterator <_Iter> {} ;
709
+ inline const bool __string_is_trivial_iterator_v <__wrap_iter<_Iter> > = __string_is_trivial_iterator_v <_Iter>;
710
710
711
711
template <class _CharT , class _Traits , class _Tp >
712
- struct __can_be_converted_to_string_view
713
- : public _BoolConstant< is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
714
- !is_convertible<const _Tp&, const _CharT*>::value > {} ;
712
+ inline const bool __can_be_converted_to_string_view_v =
713
+ is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
714
+ !is_convertible<const _Tp&, const _CharT*>::value;
715
715
716
716
struct __uninitialized_size_tag {};
717
717
struct __init_with_sentinel_tag {};
@@ -1125,7 +1125,7 @@ public:
1125
1125
}
1126
1126
1127
1127
template <class _Tp ,
1128
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1128
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1129
1129
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1130
1130
int > = 0 >
1131
1131
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -1137,7 +1137,7 @@ public:
1137
1137
}
1138
1138
1139
1139
template <class _Tp ,
1140
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1140
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1141
1141
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1142
1142
int > = 0 >
1143
1143
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string (const _Tp& __t ) {
@@ -1146,7 +1146,7 @@ public:
1146
1146
}
1147
1147
1148
1148
template <class _Tp ,
1149
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1149
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1150
1150
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1151
1151
int > = 0 >
1152
1152
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string (const _Tp& __t , const allocator_type& __a)
@@ -1205,7 +1205,7 @@ public:
1205
1205
operator =(const basic_string& __str);
1206
1206
1207
1207
template <class _Tp ,
1208
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1208
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1209
1209
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1210
1210
int > = 0 >
1211
1211
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator =(const _Tp& __t ) {
@@ -1342,7 +1342,7 @@ public:
1342
1342
}
1343
1343
1344
1344
template <class _Tp ,
1345
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1345
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1346
1346
!is_same<__remove_cvref_t <_Tp>, basic_string >::value,
1347
1347
int > = 0 >
1348
1348
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator +=(const _Tp& __t ) {
@@ -1371,7 +1371,7 @@ public:
1371
1371
}
1372
1372
1373
1373
template <class _Tp ,
1374
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1374
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1375
1375
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1376
1376
int > = 0 >
1377
1377
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (const _Tp& __t ) {
@@ -1382,7 +1382,7 @@ public:
1382
1382
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& append (const basic_string& __str, size_type __pos, size_type __n = npos);
1383
1383
1384
1384
template <class _Tp ,
1385
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1385
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1386
1386
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1387
1387
int > = 0 >
1388
1388
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
@@ -1415,7 +1415,7 @@ public:
1415
1415
size_type __cap = capacity ();
1416
1416
size_type __n = static_cast <size_type>(std::distance (__first, __last));
1417
1417
if (__n) {
1418
- if (__string_is_trivial_iterator <_ForwardIterator>::value && !__addr_in_range (*__first)) {
1418
+ if (__string_is_trivial_iterator_v <_ForwardIterator> && !__addr_in_range (*__first)) {
1419
1419
if (__cap - __sz < __n)
1420
1420
__grow_by_without_replace (__cap, __sz + __n - __cap, __sz, __sz, 0 );
1421
1421
__annotate_increase (__n);
@@ -1467,7 +1467,7 @@ public:
1467
1467
return *(data () + size () - 1 );
1468
1468
}
1469
1469
1470
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1470
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1471
1471
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign (const _Tp& __t ) {
1472
1472
__self_view __sv = __t ;
1473
1473
return assign (__sv.data (), __sv.size ());
@@ -1509,7 +1509,7 @@ public:
1509
1509
_LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& assign (const basic_string& __str, size_type __pos, size_type __n = npos);
1510
1510
1511
1511
template <class _Tp ,
1512
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1512
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1513
1513
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1514
1514
int > = 0 >
1515
1515
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
@@ -1535,7 +1535,7 @@ public:
1535
1535
template <class _ForwardIterator , __enable_if_t <__has_forward_iterator_category<_ForwardIterator>::value, int > = 0 >
1536
1536
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1537
1537
assign (_ForwardIterator __first, _ForwardIterator __last) {
1538
- if (__string_is_trivial_iterator <_ForwardIterator>::value ) {
1538
+ if (__string_is_trivial_iterator_v <_ForwardIterator>) {
1539
1539
size_type __n = static_cast <size_type>(std::distance (__first, __last));
1540
1540
__assign_trivial (__first, __last, __n);
1541
1541
} else {
@@ -1548,7 +1548,7 @@ public:
1548
1548
# if _LIBCPP_STD_VER >= 23
1549
1549
template <_ContainerCompatibleRange<_CharT> _Range>
1550
1550
_LIBCPP_HIDE_FROM_ABI constexpr basic_string& assign_range (_Range&& __range) {
1551
- if constexpr (__string_is_trivial_iterator <ranges::iterator_t <_Range>>::value &&
1551
+ if constexpr (__string_is_trivial_iterator_v <ranges::iterator_t <_Range>> &&
1552
1552
(ranges::forward_range<_Range> || ranges::sized_range<_Range>)) {
1553
1553
size_type __n = static_cast <size_type>(ranges::distance (__range));
1554
1554
__assign_trivial (ranges::begin (__range), ranges::end (__range), __n);
@@ -1572,14 +1572,14 @@ public:
1572
1572
return insert (__pos1, __str.data (), __str.size ());
1573
1573
}
1574
1574
1575
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1575
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1576
1576
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& insert (size_type __pos1, const _Tp& __t ) {
1577
1577
__self_view __sv = __t ;
1578
1578
return insert (__pos1, __sv.data (), __sv.size ());
1579
1579
}
1580
1580
1581
1581
template <class _Tp ,
1582
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1582
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1583
1583
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1584
1584
int > = 0 >
1585
1585
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
@@ -1649,7 +1649,7 @@ public:
1649
1649
return replace (__pos1, __n1, __str.data (), __str.size ());
1650
1650
}
1651
1651
1652
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1652
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1653
1653
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1654
1654
replace (size_type __pos1, size_type __n1, const _Tp& __t ) {
1655
1655
__self_view __sv = __t ;
@@ -1660,7 +1660,7 @@ public:
1660
1660
replace (size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2 = npos);
1661
1661
1662
1662
template <class _Tp ,
1663
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
1663
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
1664
1664
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
1665
1665
int > = 0 >
1666
1666
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
@@ -1683,7 +1683,7 @@ public:
1683
1683
static_cast <size_type>(__i1 - begin ()), static_cast <size_type>(__i2 - __i1), __str.data (), __str.size ());
1684
1684
}
1685
1685
1686
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1686
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1687
1687
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string&
1688
1688
replace (const_iterator __i1, const_iterator __i2, const _Tp& __t ) {
1689
1689
__self_view __sv = __t ;
@@ -1776,7 +1776,7 @@ public:
1776
1776
return std::__str_find<value_type, size_type, traits_type, npos>(data (), size (), __str.data (), __pos, __str.size ());
1777
1777
}
1778
1778
1779
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1779
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1780
1780
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1781
1781
find (const _Tp& __t , size_type __pos = 0 ) const _NOEXCEPT {
1782
1782
__self_view __sv = __t ;
@@ -1807,7 +1807,7 @@ public:
1807
1807
data (), size (), __str.data (), __pos, __str.size ());
1808
1808
}
1809
1809
1810
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1810
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1811
1811
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1812
1812
rfind (const _Tp& __t , size_type __pos = npos) const _NOEXCEPT {
1813
1813
__self_view __sv = __t ;
@@ -1838,7 +1838,7 @@ public:
1838
1838
data (), size (), __str.data (), __pos, __str.size ());
1839
1839
}
1840
1840
1841
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1841
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1842
1842
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1843
1843
find_first_of (const _Tp& __t , size_type __pos = 0 ) const _NOEXCEPT {
1844
1844
__self_view __sv = __t ;
@@ -1872,7 +1872,7 @@ public:
1872
1872
data (), size (), __str.data (), __pos, __str.size ());
1873
1873
}
1874
1874
1875
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1875
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1876
1876
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1877
1877
find_last_of (const _Tp& __t , size_type __pos = npos) const _NOEXCEPT {
1878
1878
__self_view __sv = __t ;
@@ -1906,7 +1906,7 @@ public:
1906
1906
data (), size (), __str.data (), __pos, __str.size ());
1907
1907
}
1908
1908
1909
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1909
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1910
1910
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1911
1911
find_first_not_of (const _Tp& __t , size_type __pos = 0 ) const _NOEXCEPT {
1912
1912
__self_view __sv = __t ;
@@ -1940,7 +1940,7 @@ public:
1940
1940
data (), size (), __str.data (), __pos, __str.size ());
1941
1941
}
1942
1942
1943
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1943
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1944
1944
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type
1945
1945
find_last_not_of (const _Tp& __t , size_type __pos = npos) const _NOEXCEPT {
1946
1946
__self_view __sv = __t ;
@@ -1972,7 +1972,7 @@ public:
1972
1972
return compare (__self_view (__str));
1973
1973
}
1974
1974
1975
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1975
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1976
1976
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int compare (const _Tp& __t ) const _NOEXCEPT {
1977
1977
__self_view __sv = __t ;
1978
1978
size_t __lhs_sz = size ();
@@ -1987,7 +1987,7 @@ public:
1987
1987
return 0 ;
1988
1988
}
1989
1989
1990
- template <class _Tp , __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value , int > = 0 >
1990
+ template <class _Tp , __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp>, int > = 0 >
1991
1991
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
1992
1992
compare (size_type __pos1, size_type __n1, const _Tp& __t ) const {
1993
1993
__self_view __sv = __t ;
@@ -2005,7 +2005,7 @@ public:
2005
2005
}
2006
2006
2007
2007
template <class _Tp ,
2008
- __enable_if_t <__can_be_converted_to_string_view <_CharT, _Traits, _Tp>::value &&
2008
+ __enable_if_t <__can_be_converted_to_string_view_v <_CharT, _Traits, _Tp> &&
2009
2009
!is_same<__remove_cvref_t <_Tp>, basic_string>::value,
2010
2010
int > = 0 >
2011
2011
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 int
@@ -2951,7 +2951,7 @@ template <class _Iterator, class _Sentinel>
2951
2951
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
2952
2952
basic_string<_CharT, _Traits, _Allocator>::__assign_trivial (_Iterator __first, _Sentinel __last, size_type __n) {
2953
2953
_LIBCPP_ASSERT_INTERNAL (
2954
- __string_is_trivial_iterator <_Iterator>::value , " The iterator type given to `__assign_trivial` must be trivial" );
2954
+ __string_is_trivial_iterator_v <_Iterator>, " The iterator type given to `__assign_trivial` must be trivial" );
2955
2955
2956
2956
size_type __old_size = size ();
2957
2957
size_type __cap = capacity ();
@@ -3166,7 +3166,7 @@ basic_string<_CharT, _Traits, _Allocator>::__insert_with_size(
3166
3166
if (__n == 0 )
3167
3167
return begin () + __ip;
3168
3168
3169
- if (__string_is_trivial_iterator <_Iterator>::value && !__addr_in_range (*__first)) {
3169
+ if (__string_is_trivial_iterator_v <_Iterator> && !__addr_in_range (*__first)) {
3170
3170
return __insert_from_safe_copy (__n, __ip, std::move (__first), std::move (__last));
3171
3171
} else {
3172
3172
const basic_string __temp (__init_with_sentinel_tag (), std::move (__first), std::move (__last), __alloc_);
0 commit comments