[libcxx-commits] [libcxx] [libc++] Use template variables in a bunch of places instead of class templates (PR #139518)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 12 02:13:18 PDT 2025
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/139518
This reduces compile time and memory, since template variables are more efficient. NFC otherwise.
>From 9cc630bc21766b67027afb4f670db5d94ef31434 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Mon, 12 May 2025 08:06:45 +0200
Subject: [PATCH] [libc++] Use template variables in a bunch of places instead
of class templates
---
libcxx/include/__algorithm/equal.h | 4 +-
libcxx/include/__algorithm/equal_range.h | 2 +-
libcxx/include/__algorithm/find.h | 16 +-
libcxx/include/__algorithm/includes.h | 2 +-
libcxx/include/__algorithm/is_permutation.h | 4 +-
.../__algorithm/lexicographical_compare.h | 4 +-
libcxx/include/__algorithm/lower_bound.h | 2 +-
libcxx/include/__algorithm/max_element.h | 2 +-
libcxx/include/__algorithm/min_element.h | 2 +-
libcxx/include/__algorithm/minmax.h | 2 +-
libcxx/include/__algorithm/minmax_element.h | 2 +-
libcxx/include/__algorithm/mismatch.h | 2 +-
.../include/__algorithm/partial_sort_copy.h | 4 +-
libcxx/include/__algorithm/search.h | 2 +-
libcxx/include/__algorithm/search_n.h | 2 +-
libcxx/include/__algorithm/upper_bound.h | 2 +-
libcxx/include/__expected/expected.h | 46 +-
libcxx/include/__expected/unexpected.h | 9 +-
libcxx/include/__flat_map/flat_map.h | 32 +-
libcxx/include/__flat_map/flat_multimap.h | 32 +-
libcxx/include/__flat_set/flat_multiset.h | 24 +-
libcxx/include/__flat_set/flat_set.h | 24 +-
libcxx/include/__functional/bind.h | 28 +-
libcxx/include/__functional/function.h | 3 +-
libcxx/include/__hash_table | 15 +-
libcxx/include/__mdspan/extents.h | 7 +-
libcxx/include/__mdspan/layout_left.h | 2 +-
libcxx/include/__mdspan/layout_right.h | 2 +-
libcxx/include/__mdspan/layout_stride.h | 2 +-
libcxx/include/__memory/shared_ptr.h | 17 +-
.../include/__random/discard_block_engine.h | 9 +-
.../__random/independent_bits_engine.h | 4 +-
libcxx/include/__random/is_seed_sequence.h | 6 +-
.../__random/linear_congruential_engine.h | 4 +-
.../__random/mersenne_twister_engine.h | 4 +-
.../include/__random/shuffle_order_engine.h | 9 +-
.../__random/subtract_with_carry_engine.h | 4 +-
.../include/__string/constexpr_c_functions.h | 7 +-
libcxx/include/__type_traits/invoke.h | 10 +-
libcxx/include/__type_traits/is_allocator.h | 9 +-
libcxx/include/__type_traits/is_callable.h | 2 +-
.../__type_traits/is_core_convertible.h | 9 +-
.../__type_traits/is_equality_comparable.h | 36 +-
.../__type_traits/is_reference_wrapper.h | 8 +-
libcxx/include/__utility/in_place.h | 14 +-
.../include/__utility/is_pointer_in_range.h | 10 +-
libcxx/include/__vector/vector.h | 8 +-
libcxx/include/any | 8 +-
libcxx/include/cwchar | 4 +-
libcxx/include/deque | 8 +-
libcxx/include/experimental/propagate_const | 18 +-
libcxx/include/forward_list | 8 +-
libcxx/include/list | 8 +-
libcxx/include/map | 36 +-
libcxx/include/optional | 24 +-
libcxx/include/queue | 38 +-
libcxx/include/set | 36 +-
libcxx/include/span | 6 +-
libcxx/include/sstream | 8 +-
libcxx/include/stack | 8 +-
libcxx/include/string | 14 +-
libcxx/include/unordered_map | 84 ++--
libcxx/include/unordered_set | 76 ++--
libcxx/include/valarray | 422 ++++++++----------
libcxx/include/variant | 6 +-
.../test/libcxx/memory/is_allocator.pass.cpp | 12 +-
.../type_traits/is_callable.compile.pass.cpp | 13 +-
.../is_trivially_comparable.compile.pass.cpp | 50 +--
.../utility/__is_inplace_index.pass.cpp | 28 +-
.../utility/__is_inplace_type.pass.cpp | 28 +-
70 files changed, 655 insertions(+), 738 deletions(-)
diff --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h
index 5a8c9504ede1d..22f5fe6282b1d 100644
--- a/libcxx/include/__algorithm/equal.h
+++ b/libcxx/include/__algorithm/equal.h
@@ -184,7 +184,7 @@ template <class _Tp,
class _Up,
class _BinaryPredicate,
__enable_if_t<__desugars_to_v<__equal_tag, _BinaryPredicate, _Tp, _Up> && !is_volatile<_Tp>::value &&
- !is_volatile<_Up>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ !is_volatile<_Up>::value && __is_trivially_equality_comparable_v<_Tp, _Up>,
int> = 0>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal_iter_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _BinaryPredicate&) {
@@ -225,7 +225,7 @@ template <class _Tp,
class _Proj2,
__enable_if_t<__desugars_to_v<__equal_tag, _Pred, _Tp, _Up> && __is_identity<_Proj1>::value &&
__is_identity<_Proj2>::value && !is_volatile<_Tp>::value && !is_volatile<_Up>::value &&
- __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ __is_trivially_equality_comparable_v<_Tp, _Up>,
int> = 0>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__equal_impl(_Tp* __first1, _Tp* __last1, _Up* __first2, _Up*, _Pred&, _Proj1&, _Proj2&) {
diff --git a/libcxx/include/__algorithm/equal_range.h b/libcxx/include/__algorithm/equal_range.h
index ff6f4f2225c7a..5e1a5a5ffeb06 100644
--- a/libcxx/include/__algorithm/equal_range.h
+++ b/libcxx/include/__algorithm/equal_range.h
@@ -58,7 +58,7 @@ __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
template <class _ForwardIterator, class _Tp, class _Compare>
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
- static_assert(__is_callable<_Compare&, decltype(*__first), const _Tp&>::value, "The comparator has to be callable");
+ static_assert(__is_callable_v<_Compare&, decltype(*__first), const _Tp&>, "The comparator has to be callable");
static_assert(is_copy_constructible<_ForwardIterator>::value, "Iterator has to be copy constructible");
return std::__equal_range<_ClassicAlgPolicy>(
std::move(__first),
diff --git a/libcxx/include/__algorithm/find.h b/libcxx/include/__algorithm/find.h
index a7d9374b3a1c8..f1ba3871582f6 100644
--- a/libcxx/include/__algorithm/find.h
+++ b/libcxx/include/__algorithm/find.h
@@ -52,12 +52,12 @@ __find(_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
}
// trivially equality comparable implementations
-template <class _Tp,
- class _Up,
- class _Proj,
- __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
- sizeof(_Tp) == 1,
- int> = 0>
+template <
+ class _Tp,
+ class _Up,
+ class _Proj,
+ __enable_if_t<__is_identity<_Proj>::value && __is_trivially_equality_comparable_v<_Tp, _Up> && sizeof(_Tp) == 1,
+ int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
if (auto __ret = std::__constexpr_memchr(__first, __value, __last - __first))
return __ret;
@@ -68,7 +68,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T
template <class _Tp,
class _Up,
class _Proj,
- __enable_if_t<__is_identity<_Proj>::value && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
+ __enable_if_t<__is_identity<_Proj>::value && __is_trivially_equality_comparable_v<_Tp, _Up> &&
sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t),
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _Tp* __last, const _Up& __value, _Proj&) {
@@ -83,7 +83,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T
template <class _Tp,
class _Up,
class _Proj,
- __enable_if_t<__is_identity<_Proj>::value && !__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value &&
+ __enable_if_t<__is_identity<_Proj>::value && !__is_trivially_equality_comparable_v<_Tp, _Up> &&
is_integral<_Tp>::value && is_integral<_Up>::value &&
is_signed<_Tp>::value == is_signed<_Up>::value,
int> = 0>
diff --git a/libcxx/include/__algorithm/includes.h b/libcxx/include/__algorithm/includes.h
index bc6c6579693b1..f68a764f7c1da 100644
--- a/libcxx/include/__algorithm/includes.h
+++ b/libcxx/include/__algorithm/includes.h
@@ -53,7 +53,7 @@ includes(_InputIterator1 __first1,
_InputIterator2 __last2,
_Compare __comp) {
static_assert(
- __is_callable<_Compare&, decltype(*__first1), decltype(*__first2)>::value, "The comparator has to be callable");
+ __is_callable_v<_Compare&, decltype(*__first1), decltype(*__first2)>, "The comparator has to be callable");
return std::__includes(
std::move(__first1),
diff --git a/libcxx/include/__algorithm/is_permutation.h b/libcxx/include/__algorithm/is_permutation.h
index 1afb11596bc6b..ec9ac3ec52d4e 100644
--- a/libcxx/include/__algorithm/is_permutation.h
+++ b/libcxx/include/__algorithm/is_permutation.h
@@ -250,7 +250,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation(
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool is_permutation(
_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) {
- static_assert(__is_callable<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>::value,
+ static_assert(__is_callable_v<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>,
"The comparator has to be callable");
return std::__is_permutation<_ClassicAlgPolicy>(std::move(__first1), std::move(__last1), std::move(__first2), __pred);
@@ -287,7 +287,7 @@ template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredica
_ForwardIterator2 __first2,
_ForwardIterator2 __last2,
_BinaryPredicate __pred) {
- static_assert(__is_callable<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>::value,
+ static_assert(__is_callable_v<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>,
"The comparator has to be callable");
return std::__is_permutation<_ClassicAlgPolicy>(
diff --git a/libcxx/include/__algorithm/lexicographical_compare.h b/libcxx/include/__algorithm/lexicographical_compare.h
index ebe7e3b56a292..a12add69d4d2c 100644
--- a/libcxx/include/__algorithm/lexicographical_compare.h
+++ b/libcxx/include/__algorithm/lexicographical_compare.h
@@ -66,8 +66,8 @@ template <class _Tp,
class _Proj2,
class _Comp,
__enable_if_t<__desugars_to_v<__totally_ordered_less_tag, _Comp, _Tp, _Tp> && !is_volatile<_Tp>::value &&
- __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value &&
- __is_identity<_Proj1>::value && __is_identity<_Proj2>::value,
+ __is_trivially_equality_comparable_v<_Tp, _Tp> && __is_identity<_Proj1>::value &&
+ __is_identity<_Proj2>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
__lexicographical_compare(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __last2, _Comp&, _Proj1&, _Proj2&) {
diff --git a/libcxx/include/__algorithm/lower_bound.h b/libcxx/include/__algorithm/lower_bound.h
index 4fba6748e6d71..639183568e039 100644
--- a/libcxx/include/__algorithm/lower_bound.h
+++ b/libcxx/include/__algorithm/lower_bound.h
@@ -92,7 +92,7 @@ __lower_bound(_ForwardIterator __first, _Sent __last, const _Type& __value, _Com
template <class _ForwardIterator, class _Tp, class _Compare>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
- static_assert(__is_callable<_Compare&, decltype(*__first), const _Tp&>::value, "The comparator has to be callable");
+ static_assert(__is_callable_v<_Compare&, decltype(*__first), const _Tp&>, "The comparator has to be callable");
auto __proj = std::__identity();
return std::__lower_bound<_ClassicAlgPolicy>(__first, __last, __value, __comp, __proj);
}
diff --git a/libcxx/include/__algorithm/max_element.h b/libcxx/include/__algorithm/max_element.h
index 929f337fc10ad..d66b170b760f2 100644
--- a/libcxx/include/__algorithm/max_element.h
+++ b/libcxx/include/__algorithm/max_element.h
@@ -39,7 +39,7 @@ template <class _ForwardIterator, class _Compare>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) {
static_assert(
- __is_callable<_Compare&, decltype(*__first), decltype(*__first)>::value, "The comparator has to be callable");
+ __is_callable_v<_Compare&, decltype(*__first), decltype(*__first)>, "The comparator has to be callable");
return std::__max_element<__comp_ref_type<_Compare> >(__first, __last, __comp);
}
diff --git a/libcxx/include/__algorithm/min_element.h b/libcxx/include/__algorithm/min_element.h
index fdab63aefec7e..53c561dfa214d 100644
--- a/libcxx/include/__algorithm/min_element.h
+++ b/libcxx/include/__algorithm/min_element.h
@@ -53,7 +53,7 @@ min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
static_assert(
__has_forward_iterator_category<_ForwardIterator>::value, "std::min_element requires a ForwardIterator");
static_assert(
- __is_callable<_Compare&, decltype(*__first), decltype(*__first)>::value, "The comparator has to be callable");
+ __is_callable_v<_Compare&, decltype(*__first), decltype(*__first)>, "The comparator has to be callable");
return std::__min_element<__comp_ref_type<_Compare> >(std::move(__first), std::move(__last), __comp);
}
diff --git a/libcxx/include/__algorithm/minmax.h b/libcxx/include/__algorithm/minmax.h
index de0bec0ef72fc..5b603d9223555 100644
--- a/libcxx/include/__algorithm/minmax.h
+++ b/libcxx/include/__algorithm/minmax.h
@@ -40,7 +40,7 @@ minmax(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __
template <class _Tp, class _Compare>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Tp, _Tp>
minmax(initializer_list<_Tp> __t, _Compare __comp) {
- static_assert(__is_callable<_Compare&, _Tp, _Tp>::value, "The comparator has to be callable");
+ static_assert(__is_callable_v<_Compare&, _Tp, _Tp>, "The comparator has to be callable");
__identity __proj;
auto __ret = std::__minmax_element_impl(__t.begin(), __t.end(), __comp, __proj);
return pair<_Tp, _Tp>(*__ret.first, *__ret.second);
diff --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h
index dc0c3a818cd57..db135aab8950f 100644
--- a/libcxx/include/__algorithm/minmax_element.h
+++ b/libcxx/include/__algorithm/minmax_element.h
@@ -84,7 +84,7 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com
static_assert(
__has_forward_iterator_category<_ForwardIterator>::value, "std::minmax_element requires a ForwardIterator");
static_assert(
- __is_callable<_Compare&, decltype(*__first), decltype(*__first)>::value, "The comparator has to be callable");
+ __is_callable_v<_Compare&, decltype(*__first), decltype(*__first)>, "The comparator has to be callable");
auto __proj = __identity();
return std::__minmax_element_impl(__first, __last, __comp, __proj);
}
diff --git a/libcxx/include/__algorithm/mismatch.h b/libcxx/include/__algorithm/mismatch.h
index a6836792c0581..88368c2da5acd 100644
--- a/libcxx/include/__algorithm/mismatch.h
+++ b/libcxx/include/__algorithm/mismatch.h
@@ -136,7 +136,7 @@ template <class _Tp,
class _Proj2,
__enable_if_t<!is_integral<_Tp>::value && __desugars_to_v<__equal_tag, _Pred, _Tp, _Tp> &&
__is_identity<_Proj1>::value && __is_identity<_Proj2>::value &&
- __can_map_to_integer_v<_Tp> && __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,
+ __can_map_to_integer_v<_Tp> && __is_trivially_equality_comparable_v<_Tp, _Tp>,
int> = 0>
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<_Tp*, _Tp*>
__mismatch(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
diff --git a/libcxx/include/__algorithm/partial_sort_copy.h b/libcxx/include/__algorithm/partial_sort_copy.h
index 172f53b290d54..fcc8b9039354f 100644
--- a/libcxx/include/__algorithm/partial_sort_copy.h
+++ b/libcxx/include/__algorithm/partial_sort_copy.h
@@ -76,8 +76,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandomAccessIterator
_RandomAccessIterator __result_first,
_RandomAccessIterator __result_last,
_Compare __comp) {
- static_assert(__is_callable<_Compare&, decltype(*__first), decltype(*__result_first)>::value,
- "The comparator has to be callable");
+ static_assert(
+ __is_callable_v<_Compare&, decltype(*__first), decltype(*__result_first)>, "The comparator has to be callable");
auto __result = std::__partial_sort_copy<_ClassicAlgPolicy>(
__first,
diff --git a/libcxx/include/__algorithm/search.h b/libcxx/include/__algorithm/search.h
index 161fd39d861a6..5393cebcc8c6c 100644
--- a/libcxx/include/__algorithm/search.h
+++ b/libcxx/include/__algorithm/search.h
@@ -166,7 +166,7 @@ search(_ForwardIterator1 __first1,
_ForwardIterator2 __first2,
_ForwardIterator2 __last2,
_BinaryPredicate __pred) {
- static_assert(__is_callable<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>::value,
+ static_assert(__is_callable_v<_BinaryPredicate&, decltype(*__first1), decltype(*__first2)>,
"The comparator has to be callable");
auto __proj = __identity();
return std::__search_impl(__first1, __last1, __first2, __last2, __pred, __proj, __proj).first;
diff --git a/libcxx/include/__algorithm/search_n.h b/libcxx/include/__algorithm/search_n.h
index 38474e1b2379d..8517f23c97c09 100644
--- a/libcxx/include/__algorithm/search_n.h
+++ b/libcxx/include/__algorithm/search_n.h
@@ -140,7 +140,7 @@ template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator search_n(
_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value, _BinaryPredicate __pred) {
static_assert(
- __is_callable<_BinaryPredicate&, decltype(*__first), const _Tp&>::value, "The comparator has to be callable");
+ __is_callable_v<_BinaryPredicate&, decltype(*__first), const _Tp&>, "The comparator has to be callable");
auto __proj = __identity();
return std::__search_n_impl(__first, __last, std::__convert_to_integral(__count), __value, __pred, __proj).first;
}
diff --git a/libcxx/include/__algorithm/upper_bound.h b/libcxx/include/__algorithm/upper_bound.h
index d77286c9e5af5..deb45a23816ed 100644
--- a/libcxx/include/__algorithm/upper_bound.h
+++ b/libcxx/include/__algorithm/upper_bound.h
@@ -52,7 +52,7 @@ __upper_bound(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
template <class _ForwardIterator, class _Tp, class _Compare>
[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
- static_assert(__is_callable<_Compare&, const _Tp&, decltype(*__first)>::value, "The comparator has to be callable");
+ static_assert(__is_callable_v<_Compare&, const _Tp&, decltype(*__first)>, "The comparator has to be callable");
static_assert(is_copy_constructible<_ForwardIterator>::value, "Iterator has to be copy constructible");
return std::__upper_bound<_ClassicAlgPolicy>(
std::move(__first), std::move(__last), __value, std::move(__comp), std::__identity());
diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index 0f446b870723b..f92f7a2961a70 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -65,10 +65,10 @@ template <class _Tp, class _Err>
class expected;
template <class _Tp>
-struct __is_std_expected : false_type {};
+inline constexpr bool __is_std_expected_v = false;
template <class _Tp, class _Err>
-struct __is_std_expected<expected<_Tp, _Err>> : true_type {};
+inline constexpr bool __is_std_expected_v<expected<_Tp, _Err>> = true;
struct __expected_construct_in_place_from_invoke_tag {};
struct __expected_construct_unexpected_from_invoke_tag {};
@@ -450,7 +450,7 @@ class __expected_base {
template <class _Tp, class _Err>
class expected : private __expected_base<_Tp, _Err> {
static_assert(!is_reference_v<_Tp> && !is_function_v<_Tp> && !is_same_v<remove_cv_t<_Tp>, in_place_t> &&
- !is_same_v<remove_cv_t<_Tp>, unexpect_t> && !__is_std_unexpected<remove_cv_t<_Tp>>::value &&
+ !is_same_v<remove_cv_t<_Tp>, unexpect_t> && !__is_std_unexpected_v<remove_cv_t<_Tp>> &&
__valid_std_unexpected<_Err>::value,
"[expected.object.general] A program that instantiates the definition of template expected<T, E> for a "
"reference type, a function type, or for possibly cv-qualified types in_place_t, unexpect_t, or a "
@@ -557,8 +557,8 @@ class expected : private __expected_base<_Tp, _Err> {
template <class _Up = _Tp>
requires(!is_same_v<remove_cvref_t<_Up>, in_place_t> && !is_same_v<expected, remove_cvref_t<_Up>> &&
- is_constructible_v<_Tp, _Up> && !__is_std_unexpected<remove_cvref_t<_Up>>::value &&
- (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_expected<remove_cvref_t<_Up>>::value))
+ is_constructible_v<_Tp, _Up> && !__is_std_unexpected_v<remove_cvref_t<_Up>> &&
+ (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_expected_v<remove_cvref_t<_Up>>))
_LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up, _Tp>)
expected(_Up&& __u) noexcept(is_nothrow_constructible_v<_Tp, _Up>) // strengthened
: __base(in_place, std::forward<_Up>(__u)) {}
@@ -670,7 +670,7 @@ class expected : private __expected_base<_Tp, _Err> {
template <class _Up = _Tp>
_LIBCPP_HIDE_FROM_ABI constexpr expected& operator=(_Up&& __v)
- requires(!is_same_v<expected, remove_cvref_t<_Up>> && !__is_std_unexpected<remove_cvref_t<_Up>>::value &&
+ requires(!is_same_v<expected, remove_cvref_t<_Up>> && !__is_std_unexpected_v<remove_cvref_t<_Up>> &&
is_constructible_v<_Tp, _Up> && is_assignable_v<_Tp&, _Up> &&
(is_nothrow_constructible_v<_Tp, _Up> || is_nothrow_move_constructible_v<_Tp> ||
is_nothrow_move_constructible_v<_Err>))
@@ -923,7 +923,7 @@ class expected : private __expected_base<_Tp, _Err> {
requires is_constructible_v<_Err, _Err&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f(value()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Up::error_type, _Err>,
"The result of f(value()) must have the same error_type as this expected");
if (has_value()) {
@@ -936,7 +936,7 @@ class expected : private __expected_base<_Tp, _Err> {
requires is_constructible_v<_Err, const _Err&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f(value()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f(value()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Up::error_type, _Err>,
"The result of f(value()) must have the same error_type as this expected");
if (has_value()) {
@@ -950,7 +950,7 @@ class expected : private __expected_base<_Tp, _Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
using _Up = remove_cvref_t<invoke_result_t<_Func, _Tp&&>>;
static_assert(
- __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");
+ __is_std_expected_v<_Up>, "The result of f(std::move(value())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Up::error_type, _Err>,
"The result of f(std::move(value())) must have the same error_type as this expected");
if (has_value()) {
@@ -964,7 +964,7 @@ class expected : private __expected_base<_Tp, _Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
using _Up = remove_cvref_t<invoke_result_t<_Func, const _Tp&&>>;
static_assert(
- __is_std_expected<_Up>::value, "The result of f(std::move(value())) must be a specialization of std::expected");
+ __is_std_expected_v<_Up>, "The result of f(std::move(value())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Up::error_type, _Err>,
"The result of f(std::move(value())) must have the same error_type as this expected");
if (has_value()) {
@@ -977,7 +977,7 @@ class expected : private __expected_base<_Tp, _Err> {
requires is_constructible_v<_Tp, _Tp&>
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {
using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;
- static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Gp>, "The result of f(error()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(error()) must have the same value_type as this expected");
if (has_value()) {
@@ -990,7 +990,7 @@ class expected : private __expected_base<_Tp, _Err> {
requires is_constructible_v<_Tp, const _Tp&>
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {
using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;
- static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Gp>, "The result of f(error()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(error()) must have the same value_type as this expected");
if (has_value()) {
@@ -1004,7 +1004,7 @@ class expected : private __expected_base<_Tp, _Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {
using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;
static_assert(
- __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
+ __is_std_expected_v<_Gp>, "The result of f(std::move(error())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(std::move(error())) must have the same value_type as this expected");
if (has_value()) {
@@ -1018,7 +1018,7 @@ class expected : private __expected_base<_Tp, _Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {
using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;
static_assert(
- __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
+ __is_std_expected_v<_Gp>, "The result of f(std::move(error())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(std::move(error())) must have the same value_type as this expected");
if (has_value()) {
@@ -1166,7 +1166,7 @@ class expected : private __expected_base<_Tp, _Err> {
template <class _T2>
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const expected& __x, const _T2& __v)
# if _LIBCPP_STD_VER >= 26
- requires(!__is_std_expected<_T2>::value) && requires {
+ requires(!__is_std_expected_v<_T2>) && requires {
{ *__x == __v } -> __core_convertible_to<bool>;
}
# endif
@@ -1667,7 +1667,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
requires is_constructible_v<_Err, _Err&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) & {
using _Up = remove_cvref_t<invoke_result_t<_Func>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f() must be a specialization of std::expected");
static_assert(
is_same_v<typename _Up::error_type, _Err>, "The result of f() must have the same error_type as this expected");
if (has_value()) {
@@ -1680,7 +1680,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
requires is_constructible_v<_Err, const _Err&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const& {
using _Up = remove_cvref_t<invoke_result_t<_Func>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f() must be a specialization of std::expected");
static_assert(
is_same_v<typename _Up::error_type, _Err>, "The result of f() must have the same error_type as this expected");
if (has_value()) {
@@ -1693,7 +1693,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
requires is_constructible_v<_Err, _Err&&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) && {
using _Up = remove_cvref_t<invoke_result_t<_Func>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f() must be a specialization of std::expected");
static_assert(
is_same_v<typename _Up::error_type, _Err>, "The result of f() must have the same error_type as this expected");
if (has_value()) {
@@ -1706,7 +1706,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
requires is_constructible_v<_Err, const _Err&&>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
using _Up = remove_cvref_t<invoke_result_t<_Func>>;
- static_assert(__is_std_expected<_Up>::value, "The result of f() must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Up>, "The result of f() must be a specialization of std::expected");
static_assert(
is_same_v<typename _Up::error_type, _Err>, "The result of f() must have the same error_type as this expected");
if (has_value()) {
@@ -1718,7 +1718,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
template <class _Func>
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) & {
using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&>>;
- static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Gp>, "The result of f(error()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(error()) must have the same value_type as this expected");
if (has_value()) {
@@ -1730,7 +1730,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
template <class _Func>
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const& {
using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&>>;
- static_assert(__is_std_expected<_Gp>::value, "The result of f(error()) must be a specialization of std::expected");
+ static_assert(__is_std_expected_v<_Gp>, "The result of f(error()) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(error()) must have the same value_type as this expected");
if (has_value()) {
@@ -1743,7 +1743,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) && {
using _Gp = remove_cvref_t<invoke_result_t<_Func, _Err&&>>;
static_assert(
- __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
+ __is_std_expected_v<_Gp>, "The result of f(std::move(error())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(std::move(error())) must have the same value_type as this expected");
if (has_value()) {
@@ -1756,7 +1756,7 @@ class expected<_Tp, _Err> : private __expected_void_base<_Err> {
_LIBCPP_HIDE_FROM_ABI constexpr auto or_else(_Func&& __f) const&& {
using _Gp = remove_cvref_t<invoke_result_t<_Func, const _Err&&>>;
static_assert(
- __is_std_expected<_Gp>::value, "The result of f(std::move(error())) must be a specialization of std::expected");
+ __is_std_expected_v<_Gp>, "The result of f(std::move(error())) must be a specialization of std::expected");
static_assert(is_same_v<typename _Gp::value_type, _Tp>,
"The result of f(std::move(error())) must have the same value_type as this expected");
if (has_value()) {
diff --git a/libcxx/include/__expected/unexpected.h b/libcxx/include/__expected/unexpected.h
index 6904889b8c6b1..8cbaac43e12e3 100644
--- a/libcxx/include/__expected/unexpected.h
+++ b/libcxx/include/__expected/unexpected.h
@@ -17,6 +17,7 @@
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_object.h>
#include <__type_traits/is_same.h>
+#include <__type_traits/is_specialization.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/is_volatile.h>
#include <__type_traits/negation.h>
@@ -42,16 +43,16 @@ template <class _Err>
class unexpected;
template <class _Tp>
-struct __is_std_unexpected : false_type {};
+inline constexpr bool __is_std_unexpected_v = false;
-template <class _Err>
-struct __is_std_unexpected<unexpected<_Err>> : true_type {};
+template <class _Tp>
+inline constexpr bool __is_std_unexpected_v<unexpected<_Tp>> = true;
template <class _Tp>
using __valid_std_unexpected _LIBCPP_NODEBUG = _BoolConstant< //
is_object_v<_Tp> && //
!is_array_v<_Tp> && //
- !__is_std_unexpected<_Tp>::value && //
+ !__is_std_unexpected_v<_Tp> && //
!is_const_v<_Tp> && //
!is_volatile_v<_Tp> //
>;
diff --git a/libcxx/include/__flat_map/flat_map.h b/libcxx/include/__flat_map/flat_map.h
index f5e9756ff6a60..10d1214ab5c5e 100644
--- a/libcxx/include/__flat_map/flat_map.h
+++ b/libcxx/include/__flat_map/flat_map.h
@@ -1054,8 +1054,7 @@ class flat_map {
};
template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -1068,7 +1067,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare = _Compare())
template <class _KeyContainer, class _MappedContainer, class _Allocator>
requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
- !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)
+ !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
flat_map(_KeyContainer, _MappedContainer, _Allocator)
-> flat_map<typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
@@ -1077,9 +1076,8 @@ flat_map(_KeyContainer, _MappedContainer, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&
- uses_allocator_v<_MappedContainer, _Allocator> &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
+ uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -1091,8 +1089,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -1105,7 +1102,7 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare = _Compare()
template <class _KeyContainer, class _MappedContainer, class _Allocator>
requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
- !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)
+ !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)
-> flat_map<typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
@@ -1114,9 +1111,8 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&
- uses_allocator_v<_MappedContainer, _Allocator> &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
+ uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -1128,19 +1124,19 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare, _Allocator)
_MappedContainer>;
template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_map(_InputIterator, _InputIterator, _Compare = _Compare())
-> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_map(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())
-> flat_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
template <ranges::input_range _Range,
class _Compare = less<__range_key_type<_Range>>,
class _Allocator = allocator<byte>,
- class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
+ class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_map<
__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -1148,7 +1144,7 @@ flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
-template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<
__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -1157,11 +1153,11 @@ flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
template <class _Key, class _Tp, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;
template <class _Key, class _Tp, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_map(sorted_unique_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>;
template <class _Key, class _Tp, class _Compare, class _KeyContainer, class _MappedContainer, class _Allocator>
diff --git a/libcxx/include/__flat_map/flat_multimap.h b/libcxx/include/__flat_map/flat_multimap.h
index 15fcd7995ad0a..4710fab50c0f1 100644
--- a/libcxx/include/__flat_map/flat_multimap.h
+++ b/libcxx/include/__flat_map/flat_multimap.h
@@ -863,8 +863,7 @@ class flat_multimap {
};
template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -877,7 +876,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare = _Compare())
template <class _KeyContainer, class _MappedContainer, class _Allocator>
requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
- !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)
+ !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
flat_multimap(_KeyContainer, _MappedContainer, _Allocator)
-> flat_multimap<typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
@@ -886,9 +885,8 @@ flat_multimap(_KeyContainer, _MappedContainer, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&
- uses_allocator_v<_MappedContainer, _Allocator> &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer> &&
+ uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -900,8 +898,8 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
+ !__is_allocator_v<_MappedContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -914,7 +912,7 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare = _
template <class _KeyContainer, class _MappedContainer, class _Allocator>
requires(uses_allocator_v<_KeyContainer, _Allocator> && uses_allocator_v<_MappedContainer, _Allocator> &&
- !__is_allocator<_KeyContainer>::value && !__is_allocator<_MappedContainer>::value)
+ !__is_allocator_v<_KeyContainer> && !__is_allocator_v<_MappedContainer>)
flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)
-> flat_multimap<typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
@@ -923,8 +921,8 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Allocator)
_MappedContainer>;
template <class _KeyContainer, class _MappedContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
- !__is_allocator<_MappedContainer>::value && uses_allocator_v<_KeyContainer, _Allocator> &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
+ !__is_allocator_v<_MappedContainer> && uses_allocator_v<_KeyContainer, _Allocator> &&
uses_allocator_v<_MappedContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
@@ -937,19 +935,19 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare, _A
_MappedContainer>;
template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_multimap(_InputIterator, _InputIterator, _Compare = _Compare())
-> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
template <class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_multimap(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())
-> flat_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare>;
template <ranges::input_range _Range,
class _Compare = less<__range_key_type<_Range>>,
class _Allocator = allocator<byte>,
- class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
+ class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multimap<
__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -957,7 +955,7 @@ flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Alloc
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
-template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<
__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -966,11 +964,11 @@ flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap<
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
template <class _Key, class _Tp, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare()) -> flat_multimap<_Key, _Tp, _Compare>;
template <class _Key, class _Tp, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_multimap(sorted_equivalent_t, initializer_list<pair<_Key, _Tp>>, _Compare = _Compare())
-> flat_multimap<_Key, _Tp, _Compare>;
diff --git a/libcxx/include/__flat_set/flat_multiset.h b/libcxx/include/__flat_set/flat_multiset.h
index 0fed377b25e5a..cb32a4c11e111 100644
--- a/libcxx/include/__flat_set/flat_multiset.h
+++ b/libcxx/include/__flat_set/flat_multiset.h
@@ -689,7 +689,7 @@ class flat_multiset {
};
template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -697,12 +697,12 @@ flat_multiset(_KeyContainer, _Compare = _Compare())
-> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Allocator>
- requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)
+ requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
flat_multiset(_KeyContainer, _Allocator)
-> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
template <class _KeyContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
uses_allocator_v<_KeyContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
@@ -711,7 +711,7 @@ flat_multiset(_KeyContainer, _Compare, _Allocator)
-> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -719,12 +719,12 @@ flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare = _Compare())
-> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Allocator>
- requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)
+ requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
flat_multiset(sorted_equivalent_t, _KeyContainer, _Allocator)
-> flat_multiset<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
template <class _KeyContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
uses_allocator_v<_KeyContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
@@ -733,36 +733,36 @@ flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare, _Allocator)
-> flat_multiset<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_multiset(_InputIterator, _InputIterator, _Compare = _Compare())
-> flat_multiset<__iter_value_type<_InputIterator>, _Compare>;
template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_multiset(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())
-> flat_multiset<__iter_value_type<_InputIterator>, _Compare>;
template <ranges::input_range _Range,
class _Compare = less<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
+ class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
flat_multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multiset<
ranges::range_value_t<_Range>,
_Compare,
vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
-template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
flat_multiset(from_range_t, _Range&&, _Allocator) -> flat_multiset<
ranges::range_value_t<_Range>,
less<ranges::range_value_t<_Range>>,
vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
template <class _Key, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_multiset(initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;
template <class _Key, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_multiset(sorted_equivalent_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>;
template <class _Key, class _Compare, class _KeyContainer, class _Allocator>
diff --git a/libcxx/include/__flat_set/flat_set.h b/libcxx/include/__flat_set/flat_set.h
index a87496bb9916e..0245888e2ee4c 100644
--- a/libcxx/include/__flat_set/flat_set.h
+++ b/libcxx/include/__flat_set/flat_set.h
@@ -721,19 +721,19 @@ class flat_set {
};
template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
flat_set(_KeyContainer, _Compare = _Compare()) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Allocator>
- requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)
+ requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
flat_set(_KeyContainer, _Allocator)
-> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
template <class _KeyContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
uses_allocator_v<_KeyContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
@@ -741,7 +741,7 @@ template <class _KeyContainer, class _Compare, class _Allocator>
flat_set(_KeyContainer, _Compare, _Allocator) -> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Compare = less<typename _KeyContainer::value_type>>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
const typename _KeyContainer::value_type&>)
@@ -749,12 +749,12 @@ flat_set(sorted_unique_t, _KeyContainer, _Compare = _Compare())
-> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _KeyContainer, class _Allocator>
- requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator<_KeyContainer>::value)
+ requires(uses_allocator_v<_KeyContainer, _Allocator> && !__is_allocator_v<_KeyContainer>)
flat_set(sorted_unique_t, _KeyContainer, _Allocator)
-> flat_set<typename _KeyContainer::value_type, less<typename _KeyContainer::value_type>, _KeyContainer>;
template <class _KeyContainer, class _Compare, class _Allocator>
- requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value &&
+ requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> &&
uses_allocator_v<_KeyContainer, _Allocator> &&
is_invocable_v<const _Compare&,
const typename _KeyContainer::value_type&,
@@ -763,36 +763,36 @@ flat_set(sorted_unique_t, _KeyContainer, _Compare, _Allocator)
-> flat_set<typename _KeyContainer::value_type, _Compare, _KeyContainer>;
template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_set(_InputIterator, _InputIterator, _Compare = _Compare())
-> flat_set<__iter_value_type<_InputIterator>, _Compare>;
template <class _InputIterator, class _Compare = less<__iter_value_type<_InputIterator>>>
- requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator<_Compare>::value)
+ requires(__has_input_iterator_category<_InputIterator>::value && !__is_allocator_v<_Compare>)
flat_set(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())
-> flat_set<__iter_value_type<_InputIterator>, _Compare>;
template <ranges::input_range _Range,
class _Compare = less<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
+ class = __enable_if_t<!__is_allocator_v<_Compare> && __is_allocator_v<_Allocator>>>
flat_set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_set<
ranges::range_value_t<_Range>,
_Compare,
vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
-template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator_v<_Allocator>>>
flat_set(from_range_t, _Range&&, _Allocator) -> flat_set<
ranges::range_value_t<_Range>,
less<ranges::range_value_t<_Range>>,
vector<ranges::range_value_t<_Range>, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>;
template <class _Key, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_set(initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;
template <class _Key, class _Compare = less<_Key>>
- requires(!__is_allocator<_Compare>::value)
+ requires(!__is_allocator_v<_Compare>)
flat_set(sorted_unique_t, initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>;
template <class _Key, class _Compare, class _KeyContainer, class _Allocator>
diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index 596cce03cdb58..34427b1c8e788 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -110,11 +110,11 @@ __mu(_Ti&, _Uj& __uj) {
return std::forward<typename tuple_element<__indx, _Uj>::type>(std::get<__indx>(__uj));
}
-template <class _Ti,
- class _Uj,
- __enable_if_t<!is_bind_expression<_Ti>::value && is_placeholder<_Ti>::value == 0 &&
- !__is_reference_wrapper<_Ti>::value,
- int> = 0>
+template <
+ class _Ti,
+ class _Uj,
+ __enable_if_t<!is_bind_expression<_Ti>::value && is_placeholder<_Ti>::value == 0 && !__is_reference_wrapper_v<_Ti>,
+ int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti, _Uj&) {
return __ti;
}
@@ -156,27 +156,23 @@ template <class _Ti, class _TupleUj>
struct __mu_return
: public __mu_return_impl<
_Ti,
- __is_reference_wrapper<_Ti>::value,
+ __is_reference_wrapper_v<_Ti>,
is_bind_expression<_Ti>::value,
0 < is_placeholder<_Ti>::value && is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
_TupleUj> {};
template <class _Fp, class _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return {
- static const bool value = false;
-};
+inline const bool __is_valid_bind_return_v = false;
template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> {
- static const bool value = __is_invocable_v<_Fp, typename __mu_return<_BoundArgs, _TupleUj>::type...>;
-};
+inline const bool __is_valid_bind_return_v<_Fp, tuple<_BoundArgs...>, _TupleUj> =
+ __is_invocable_v<_Fp, typename __mu_return<_BoundArgs, _TupleUj>::type...>;
template <class _Fp, class... _BoundArgs, class _TupleUj>
-struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> {
- static const bool value = __is_invocable_v<_Fp, typename __mu_return<const _BoundArgs, _TupleUj>::type...>;
-};
+inline const bool __is_valid_bind_return_v<_Fp, const tuple<_BoundArgs...>, _TupleUj> =
+ __is_invocable_v<_Fp, typename __mu_return<const _BoundArgs, _TupleUj>::type...>;
-template <class _Fp, class _BoundArgs, class _TupleUj, bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
+template <class _Fp, class _BoundArgs, class _TupleUj, bool = __is_valid_bind_return_v<_Fp, _BoundArgs, _TupleUj> >
struct __bind_return;
template <class _Fp, class... _BoundArgs, class _TupleUj>
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index e33c5ab9b8860..c244a576a6b25 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -843,8 +843,7 @@ class function<_Rp(_ArgTypes...)>
struct __callable;
template <class _Fp>
struct __callable<_Fp, true> {
- static const bool value =
- is_void<_Rp>::value || __is_core_convertible<__invoke_result_t<_Fp, _ArgTypes...>, _Rp>::value;
+ static const bool value = is_void<_Rp>::value || __is_core_convertible_v<__invoke_result_t<_Fp, _ArgTypes...>, _Rp>;
};
template <class _Fp>
struct __callable<_Fp, false> {
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index aefa8e19c1864..5ac4957da87e4 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -37,6 +37,7 @@
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/is_same.h>
+#include <__type_traits/is_specialization.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/remove_const.h>
#include <__type_traits/remove_cvref.h>
@@ -58,17 +59,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Key, class _Tp>
struct __hash_value_type;
-template <class _Tp>
-struct __is_hash_value_type_imp : false_type {};
-
-template <class _Key, class _Value>
-struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value> > : true_type {};
-
template <class... _Args>
-struct __is_hash_value_type : false_type {};
+inline const bool __is_hash_value_type_v = false;
template <class _One>
-struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
+inline const bool __is_hash_value_type_v<_One> = __is_specialization_v<__remove_cvref_t<_One>, __hash_value_type>;
_LIBCPP_EXPORTED_FROM_ABI size_t __next_prime(size_t __n);
@@ -1813,7 +1808,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&&... __args) {
- static_assert(!__is_hash_value_type<_Args...>::value, "Construct cannot be called with a hash value type");
+ static_assert(!__is_hash_value_type_v<_Args...>, "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
@@ -1837,7 +1832,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _First, class... _Rest>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest) {
- static_assert(!__is_hash_value_type<_First, _Rest...>::value, "Construct cannot be called with a hash value type");
+ static_assert(!__is_hash_value_type_v<_First, _Rest...>, "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
std::__construct_at(std::addressof(*__h), /* next = */ nullptr, /* hash = */ __hash);
diff --git a/libcxx/include/__mdspan/extents.h b/libcxx/include/__mdspan/extents.h
index 00454004851d5..6b19e317d9554 100644
--- a/libcxx/include/__mdspan/extents.h
+++ b/libcxx/include/__mdspan/extents.h
@@ -476,13 +476,10 @@ namespace __mdspan_detail {
// Helper type traits for identifying a class as extents.
template <class _Tp>
-struct __is_extents : false_type {};
+inline constexpr bool __is_extents_v = false;
template <class _IndexType, size_t... _ExtentsPack>
-struct __is_extents<extents<_IndexType, _ExtentsPack...>> : true_type {};
-
-template <class _Tp>
-inline constexpr bool __is_extents_v = __is_extents<_Tp>::value;
+inline constexpr bool __is_extents_v<extents<_IndexType, _ExtentsPack...>> = true;
// Function to check whether a set of indices are a multidimensional
// index into extents. This is a word of power in the C++ standard
diff --git a/libcxx/include/__mdspan/layout_left.h b/libcxx/include/__mdspan/layout_left.h
index 2f515afb6c860..86c0ff99a3731 100644
--- a/libcxx/include/__mdspan/layout_left.h
+++ b/libcxx/include/__mdspan/layout_left.h
@@ -43,7 +43,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Extents>
class layout_left::mapping {
public:
- static_assert(__mdspan_detail::__is_extents<_Extents>::value,
+ static_assert(__mdspan_detail::__is_extents_v<_Extents>,
"layout_left::mapping template argument must be a specialization of extents.");
using extents_type = _Extents;
diff --git a/libcxx/include/__mdspan/layout_right.h b/libcxx/include/__mdspan/layout_right.h
index ccfbd23e28ad7..314be43fd0e29 100644
--- a/libcxx/include/__mdspan/layout_right.h
+++ b/libcxx/include/__mdspan/layout_right.h
@@ -43,7 +43,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Extents>
class layout_right::mapping {
public:
- static_assert(__mdspan_detail::__is_extents<_Extents>::value,
+ static_assert(__mdspan_detail::__is_extents_v<_Extents>,
"layout_right::mapping template argument must be a specialization of extents.");
using extents_type = _Extents;
diff --git a/libcxx/include/__mdspan/layout_stride.h b/libcxx/include/__mdspan/layout_stride.h
index 9d77d71bc3598..91fef91f4848f 100644
--- a/libcxx/include/__mdspan/layout_stride.h
+++ b/libcxx/include/__mdspan/layout_stride.h
@@ -68,7 +68,7 @@ concept __layout_mapping_alike = requires {
template <class _Extents>
class layout_stride::mapping {
public:
- static_assert(__mdspan_detail::__is_extents<_Extents>::value,
+ static_assert(__mdspan_detail::__is_extents_v<_Extents>,
"layout_stride::mapping template argument must be a specialization of extents.");
using extents_type = _Extents;
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index f1b2e2dbfc0cd..c5d6a53e01216 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -269,14 +269,14 @@ struct __raw_pointer_compatible_with : is_convertible<_Yp*, _Tp*> {};
#endif // _LIBCPP_STD_VER >= 17
template <class _Ptr, class = void>
-struct __is_deletable : false_type {};
+inline const bool __is_deletable_v = false;
template <class _Ptr>
-struct __is_deletable<_Ptr, decltype(delete std::declval<_Ptr>())> : true_type {};
+inline const bool __is_deletable_v<_Ptr, decltype(delete std::declval<_Ptr>())> = true;
template <class _Ptr, class = void>
-struct __is_array_deletable : false_type {};
+inline const bool __is_array_deletable_v = false;
template <class _Ptr>
-struct __is_array_deletable<_Ptr, decltype(delete[] std::declval<_Ptr>())> : true_type {};
+inline const bool __is_array_deletable_v<_Ptr, decltype(delete[] std::declval<_Ptr>())> = true;
template <class _Dp, class _Pt, class = decltype(std::declval<_Dp>()(std::declval<_Pt>()))>
true_type __well_formed_deleter_test(int);
@@ -331,16 +331,15 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT : __ptr_(nullptr), __cntrl_(nullptr) {}
template <class _Yp,
- __enable_if_t< _And< __raw_pointer_compatible_with<_Yp, _Tp>
+ __enable_if_t<__raw_pointer_compatible_with<_Yp, _Tp>::value
// In C++03 we get errors when trying to do SFINAE with the
// delete operator, so we always pretend that it's deletable.
// The same happens on GCC.
#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)
- ,
- _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
+ && (is_array<_Tp>::value ? __is_array_deletable_v<_Yp*> : __is_deletable_v<_Yp*>)
#endif
- >::value,
- int> = 0>
+ ,
+ int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) {
unique_ptr<_Yp> __hold(__p);
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
diff --git a/libcxx/include/__random/discard_block_engine.h b/libcxx/include/__random/discard_block_engine.h
index 12d1ff318ccd2..a6e1997fc1c2d 100644
--- a/libcxx/include/__random/discard_block_engine.h
+++ b/libcxx/include/__random/discard_block_engine.h
@@ -64,10 +64,9 @@ class discard_block_engine {
_LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Engine&& __e) : __e_(std::move(__e)), __n_(0) {}
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
- template <
- class _Sseq,
- __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value && !is_convertible<_Sseq, _Engine>::value,
- int> = 0>
+ template <class _Sseq,
+ __enable_if_t<__is_seed_sequence_v<_Sseq, discard_block_engine> && !is_convertible<_Sseq, _Engine>::value,
+ int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit discard_block_engine(_Sseq& __q) : __e_(__q), __n_(0) {}
_LIBCPP_HIDE_FROM_ABI void seed() {
__e_.seed();
@@ -77,7 +76,7 @@ class discard_block_engine {
__e_.seed(__sd);
__n_ = 0;
}
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, discard_block_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__e_.seed(__q);
__n_ = 0;
diff --git a/libcxx/include/__random/independent_bits_engine.h b/libcxx/include/__random/independent_bits_engine.h
index 7484857049414..947ed1f55ddc9 100644
--- a/libcxx/include/__random/independent_bits_engine.h
+++ b/libcxx/include/__random/independent_bits_engine.h
@@ -94,12 +94,12 @@ class independent_bits_engine {
_LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
template <
class _Sseq,
- __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value && !is_convertible<_Sseq, _Engine>::value,
+ __enable_if_t<__is_seed_sequence_v<_Sseq, independent_bits_engine> && !is_convertible<_Sseq, _Engine>::value,
int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit independent_bits_engine(_Sseq& __q) : __e_(__q) {}
_LIBCPP_HIDE_FROM_ABI void seed() { __e_.seed(); }
_LIBCPP_HIDE_FROM_ABI void seed(result_type __sd) { __e_.seed(__sd); }
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, independent_bits_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__e_.seed(__q);
}
diff --git a/libcxx/include/__random/is_seed_sequence.h b/libcxx/include/__random/is_seed_sequence.h
index c7171cff2eda0..8b675cccd4474 100644
--- a/libcxx/include/__random/is_seed_sequence.h
+++ b/libcxx/include/__random/is_seed_sequence.h
@@ -21,10 +21,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Sseq, class _Engine>
-struct __is_seed_sequence {
- static _LIBCPP_CONSTEXPR const bool value =
- !is_convertible<_Sseq, typename _Engine::result_type>::value && !is_same<__remove_cv_t<_Sseq>, _Engine>::value;
-};
+inline const bool __is_seed_sequence_v =
+ !is_convertible<_Sseq, typename _Engine::result_type>::value && !is_same<__remove_cv_t<_Sseq>, _Engine>::value;
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__random/linear_congruential_engine.h b/libcxx/include/__random/linear_congruential_engine.h
index f74129d9b8ffe..e8d3425097e07 100644
--- a/libcxx/include/__random/linear_congruential_engine.h
+++ b/libcxx/include/__random/linear_congruential_engine.h
@@ -265,14 +265,14 @@ class linear_congruential_engine {
#else
_LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(result_type __s = default_seed) { seed(__s); }
#endif
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, linear_congruential_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit linear_congruential_engine(_Sseq& __q) {
seed(__q);
}
_LIBCPP_HIDE_FROM_ABI void seed(result_type __s = default_seed) {
seed(integral_constant<bool, __m == 0>(), integral_constant<bool, __c == 0>(), __s);
}
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, linear_congruential_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__seed(
__q,
diff --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h
index c60fe1529bf57..132e3c0826678 100644
--- a/libcxx/include/__random/mersenne_twister_engine.h
+++ b/libcxx/include/__random/mersenne_twister_engine.h
@@ -190,12 +190,12 @@ class mersenne_twister_engine {
#else
_LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(result_type __sd = default_seed) { seed(__sd); }
#endif
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, mersenne_twister_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit mersenne_twister_engine(_Sseq& __q) {
seed(__q);
}
_LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, mersenne_twister_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());
}
diff --git a/libcxx/include/__random/shuffle_order_engine.h b/libcxx/include/__random/shuffle_order_engine.h
index 64d73033a1609..febce5c7198dc 100644
--- a/libcxx/include/__random/shuffle_order_engine.h
+++ b/libcxx/include/__random/shuffle_order_engine.h
@@ -88,10 +88,9 @@ class shuffle_order_engine {
_LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Engine&& __e) : __e_(std::move(__e)) { __init(); }
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(result_type __sd) : __e_(__sd) { __init(); }
- template <
- class _Sseq,
- __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value && !is_convertible<_Sseq, _Engine>::value,
- int> = 0>
+ template <class _Sseq,
+ __enable_if_t<__is_seed_sequence_v<_Sseq, shuffle_order_engine> && !is_convertible<_Sseq, _Engine>::value,
+ int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit shuffle_order_engine(_Sseq& __q) : __e_(__q) {
__init();
}
@@ -103,7 +102,7 @@ class shuffle_order_engine {
__e_.seed(__sd);
__init();
}
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, shuffle_order_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__e_.seed(__q);
__init();
diff --git a/libcxx/include/__random/subtract_with_carry_engine.h b/libcxx/include/__random/subtract_with_carry_engine.h
index c2b17cc889769..cbff7c8fa18a2 100644
--- a/libcxx/include/__random/subtract_with_carry_engine.h
+++ b/libcxx/include/__random/subtract_with_carry_engine.h
@@ -86,14 +86,14 @@ class subtract_with_carry_engine {
#else
_LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(result_type __sd = default_seed) { seed(__sd); }
#endif
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, subtract_with_carry_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI explicit subtract_with_carry_engine(_Sseq& __q) {
seed(__q);
}
_LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed) {
seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());
}
- template <class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
+ template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, subtract_with_carry_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());
}
diff --git a/libcxx/include/__string/constexpr_c_functions.h b/libcxx/include/__string/constexpr_c_functions.h
index 119669e16bbcf..fd2361e82ad16 100644
--- a/libcxx/include/__string/constexpr_c_functions.h
+++ b/libcxx/include/__string/constexpr_c_functions.h
@@ -96,14 +96,13 @@ __constexpr_memcmp(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
}
}
-// Because of __libcpp_is_trivially_equality_comparable we know that comparing the object representations is equivalent
+// Because of __is_trivially_equality_comparable_v we know that comparing the object representations is equivalent
// to a std::memcmp(...) == 0. Since we have multiple objects contiguously in memory, we can call memcmp once instead
// of invoking it on every object individually.
template <class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
__constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n) {
- static_assert(__libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
- "_Tp and _Up have to be trivially equality comparable");
+ static_assert(__is_trivially_equality_comparable_v<_Tp, _Up>, "_Tp and _Up have to be trivially equality comparable");
auto __count = static_cast<size_t>(__n);
@@ -128,7 +127,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n
template <class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_memchr(_Tp* __str, _Up __value, size_t __count) {
- static_assert(sizeof(_Tp) == 1 && __libcpp_is_trivially_equality_comparable<_Tp, _Up>::value,
+ static_assert(sizeof(_Tp) == 1 && __is_trivially_equality_comparable_v<_Tp, _Up>,
"Calling memchr on non-trivially equality comparable types is unsafe.");
if (__libcpp_is_constant_evaluated()) {
diff --git a/libcxx/include/__type_traits/invoke.h b/libcxx/include/__type_traits/invoke.h
index ccf86209d2295..109c67c8f6a82 100644
--- a/libcxx/include/__type_traits/invoke.h
+++ b/libcxx/include/__type_traits/invoke.h
@@ -80,7 +80,7 @@ using __enable_if_bullet1 _LIBCPP_NODEBUG =
template <class _Fp, class _A0, class _DecayFp = __decay_t<_Fp>, class _DecayA0 = __decay_t<_A0> >
using __enable_if_bullet2 _LIBCPP_NODEBUG =
- __enable_if_t<is_member_function_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value>;
+ __enable_if_t<is_member_function_pointer<_DecayFp>::value && __is_reference_wrapper_v<_DecayA0> >;
template <class _Fp,
class _A0,
@@ -90,7 +90,7 @@ template <class _Fp,
using __enable_if_bullet3 _LIBCPP_NODEBUG =
__enable_if_t<is_member_function_pointer<_DecayFp>::value &&
!(is_same<_ClassT, _DecayA0>::value || is_base_of<_ClassT, _DecayA0>::value) &&
- !__is_reference_wrapper<_DecayA0>::value>;
+ !__is_reference_wrapper_v<_DecayA0> >;
template <class _Fp,
class _A0,
@@ -103,7 +103,7 @@ using __enable_if_bullet4 _LIBCPP_NODEBUG =
template <class _Fp, class _A0, class _DecayFp = __decay_t<_Fp>, class _DecayA0 = __decay_t<_A0> >
using __enable_if_bullet5 _LIBCPP_NODEBUG =
- __enable_if_t<is_member_object_pointer<_DecayFp>::value && __is_reference_wrapper<_DecayA0>::value>;
+ __enable_if_t<is_member_object_pointer<_DecayFp>::value && __is_reference_wrapper_v<_DecayA0> >;
template <class _Fp,
class _A0,
@@ -113,7 +113,7 @@ template <class _Fp,
using __enable_if_bullet6 _LIBCPP_NODEBUG =
__enable_if_t<is_member_object_pointer<_DecayFp>::value &&
!(is_same<_ClassT, _DecayA0>::value || is_base_of<_ClassT, _DecayA0>::value) &&
- !__is_reference_wrapper<_DecayA0>::value>;
+ !__is_reference_wrapper_v<_DecayA0> >;
// __invoke forward declarations
@@ -192,7 +192,7 @@ struct __invokable_r {
using _Result _LIBCPP_NODEBUG = decltype(__try_call<_Fp, _Args...>(0));
using type = __conditional_t<_IsNotSame<_Result, __nat>::value,
- __conditional_t<is_void<_Ret>::value, true_type, __is_core_convertible<_Result, _Ret> >,
+ integral_constant<bool, is_void<_Ret>::value || __is_core_convertible_v<_Result, _Ret> >,
false_type>;
static const bool value = type::value;
};
diff --git a/libcxx/include/__type_traits/is_allocator.h b/libcxx/include/__type_traits/is_allocator.h
index 191eeb9a1f522..af13ba67d16e4 100644
--- a/libcxx/include/__type_traits/is_allocator.h
+++ b/libcxx/include/__type_traits/is_allocator.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__cstddef/size_t.h>
-#include <__type_traits/integral_constant.h>
#include <__type_traits/void_t.h>
#include <__utility/declval.h>
@@ -22,12 +21,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <typename _Alloc, typename = void, typename = void>
-struct __is_allocator : false_type {};
+inline const bool __is_allocator_v = false;
template <typename _Alloc>
-struct __is_allocator<_Alloc,
- __void_t<typename _Alloc::value_type>,
- __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))> > : true_type {};
+inline const bool __is_allocator_v<_Alloc,
+ __void_t<typename _Alloc::value_type>,
+ __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))> > = true;
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__type_traits/is_callable.h b/libcxx/include/__type_traits/is_callable.h
index 49724fe892ee5..169382986d32f 100644
--- a/libcxx/include/__type_traits/is_callable.h
+++ b/libcxx/include/__type_traits/is_callable.h
@@ -25,7 +25,7 @@ template <class...>
false_type __is_callable_helper(...);
template <class _Func, class... _Args>
-struct __is_callable : decltype(std::__is_callable_helper<_Func, _Args...>(0)) {};
+inline const bool __is_callable_v = decltype(std::__is_callable_helper<_Func, _Args...>(0))::value;
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__type_traits/is_core_convertible.h b/libcxx/include/__type_traits/is_core_convertible.h
index ca3a346c17cd7..73c74a64f29ed 100644
--- a/libcxx/include/__type_traits/is_core_convertible.h
+++ b/libcxx/include/__type_traits/is_core_convertible.h
@@ -10,7 +10,6 @@
#define _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
#include <__config>
-#include <__type_traits/integral_constant.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -24,16 +23,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// and __is_core_convertible<immovable-type,immovable-type> is true in C++17 and later.
template <class _Tp, class _Up, class = void>
-struct __is_core_convertible : false_type {};
+inline const bool __is_core_convertible_v = false;
template <class _Tp, class _Up>
-struct __is_core_convertible<_Tp, _Up, decltype(static_cast<void (*)(_Up)>(0)(static_cast<_Tp (*)()>(0)()))>
- : true_type {};
+inline const bool
+ __is_core_convertible_v<_Tp, _Up, decltype(static_cast<void (*)(_Up)>(0)(static_cast<_Tp (*)()>(0)()))> = true;
#if _LIBCPP_STD_VER >= 20
template <class _Tp, class _Up>
-concept __core_convertible_to = __is_core_convertible<_Tp, _Up>::value;
+concept __core_convertible_to = __is_core_convertible_v<_Tp, _Up>;
#endif // _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__type_traits/is_equality_comparable.h b/libcxx/include/__type_traits/is_equality_comparable.h
index 3ee1839996bef..d8d56c1ef411e 100644
--- a/libcxx/include/__type_traits/is_equality_comparable.h
+++ b/libcxx/include/__type_traits/is_equality_comparable.h
@@ -11,7 +11,6 @@
#include <__config>
#include <__type_traits/enable_if.h>
-#include <__type_traits/integral_constant.h>
#include <__type_traits/is_integral.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_signed.h>
@@ -27,11 +26,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Up, class = void>
-struct __is_equality_comparable : false_type {};
+inline const bool __is_equality_comparable_v = false;
template <class _Tp, class _Up>
-struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > : true_type {
-};
+inline const bool
+ __is_equality_comparable_v<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() == std::declval<_Up>())> > = true;
// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`
// (with `a` and `b` being of type `T`). For the case where we compare two object of the same type, we can use
@@ -48,40 +47,35 @@ struct __is_equality_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>()
// representation may not be equivalent.
template <class _Tp, class _Up, class = void>
-struct __libcpp_is_trivially_equality_comparable_impl : false_type {};
+inline const bool __is_trivially_equality_comparable_impl = false;
template <class _Tp>
-struct __libcpp_is_trivially_equality_comparable_impl<_Tp, _Tp>
+inline const bool __is_trivially_equality_comparable_impl<_Tp, _Tp>
#if __has_builtin(__is_trivially_equality_comparable)
- : integral_constant<bool, __is_trivially_equality_comparable(_Tp) && __is_equality_comparable<_Tp, _Tp>::value> {
-};
+ = __is_trivially_equality_comparable(_Tp) && __is_equality_comparable_v<_Tp, _Tp>;
#else
- : is_integral<_Tp> {
-};
+ = is_integral<_Tp>::value;
#endif // __has_builtin(__is_trivially_equality_comparable)
template <class _Tp, class _Up>
-struct __libcpp_is_trivially_equality_comparable_impl<
+inline const bool __is_trivially_equality_comparable_impl<
_Tp,
_Up,
__enable_if_t<is_integral<_Tp>::value && is_integral<_Up>::value && !is_same<_Tp, _Up>::value &&
- is_signed<_Tp>::value == is_signed<_Up>::value && sizeof(_Tp) == sizeof(_Up)> > : true_type {};
+ is_signed<_Tp>::value == is_signed<_Up>::value && sizeof(_Tp) == sizeof(_Up)> > = true;
template <class _Tp>
-struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Tp*> : true_type {};
+inline const bool __is_trivially_equality_comparable_impl<_Tp*, _Tp*> = true;
// TODO: Use is_pointer_inverconvertible_base_of
template <class _Tp, class _Up>
-struct __libcpp_is_trivially_equality_comparable_impl<_Tp*, _Up*>
- : integral_constant<
- bool,
- __is_equality_comparable<_Tp*, _Up*>::value &&
- (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value)> {
-};
+inline const bool __is_trivially_equality_comparable_impl<_Tp*, _Up*> =
+ __is_equality_comparable_v<_Tp*, _Up*> &&
+ (is_same<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >::value || is_void<_Tp>::value || is_void<_Up>::value);
template <class _Tp, class _Up>
-using __libcpp_is_trivially_equality_comparable _LIBCPP_NODEBUG =
- __libcpp_is_trivially_equality_comparable_impl<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >;
+inline const bool __is_trivially_equality_comparable_v =
+ __is_trivially_equality_comparable_impl<__remove_cv_t<_Tp>, __remove_cv_t<_Up> >;
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__type_traits/is_reference_wrapper.h b/libcxx/include/__type_traits/is_reference_wrapper.h
index 4bd8ebd44f05f..ba73b13e765f2 100644
--- a/libcxx/include/__type_traits/is_reference_wrapper.h
+++ b/libcxx/include/__type_traits/is_reference_wrapper.h
@@ -11,7 +11,7 @@
#include <__config>
#include <__fwd/functional.h>
-#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_specialization.h>
#include <__type_traits/remove_cv.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -21,11 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct __is_reference_wrapper_impl : false_type {};
-template <class _Tp>
-struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : true_type {};
-template <class _Tp>
-struct __is_reference_wrapper : __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {};
+inline const bool __is_reference_wrapper_v = __is_specialization_v<__remove_cv_t<_Tp>, reference_wrapper>;
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h
index ade4b6685a116..fc59b81e9220f 100644
--- a/libcxx/include/__utility/in_place.h
+++ b/libcxx/include/__utility/in_place.h
@@ -12,6 +12,7 @@
#include <__config>
#include <__cstddef/size_t.h>
#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_specialization.h>
#include <__type_traits/remove_cvref.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -42,20 +43,15 @@ template <size_t _Idx>
inline constexpr in_place_index_t<_Idx> in_place_index{};
template <class _Tp>
-struct __is_inplace_type_imp : false_type {};
-template <class _Tp>
-struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
-
-template <class _Tp>
-using __is_inplace_type _LIBCPP_NODEBUG = __is_inplace_type_imp<__remove_cvref_t<_Tp>>;
+inline constexpr bool __is_in_place_type_v = __is_specialization_v<__remove_cvref_t<_Tp>, in_place_type_t>;
template <class _Tp>
-struct __is_inplace_index_imp : false_type {};
+inline constexpr bool __is_in_place_index_impl = false;
template <size_t _Idx>
-struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
+inline constexpr bool __is_in_place_index_impl<in_place_index_t<_Idx>> = true;
template <class _Tp>
-using __is_inplace_index _LIBCPP_NODEBUG = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
+inline constexpr bool __is_in_place_index_v = __is_in_place_index_impl<__remove_cvref_t<_Tp>>;
#endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__utility/is_pointer_in_range.h b/libcxx/include/__utility/is_pointer_in_range.h
index 55fac6256b74e..10b6595c59710 100644
--- a/libcxx/include/__utility/is_pointer_in_range.h
+++ b/libcxx/include/__utility/is_pointer_in_range.h
@@ -26,13 +26,13 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Up, class = void>
-struct __is_less_than_comparable : false_type {};
+inline const bool __is_less_than_comparable_v = false;
template <class _Tp, class _Up>
-struct __is_less_than_comparable<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() < std::declval<_Up>())> > : true_type {
-};
+inline const bool
+ __is_less_than_comparable_v<_Tp, _Up, __void_t<decltype(std::declval<_Tp>() < std::declval<_Up>())> > = true;
-template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>
+template <class _Tp, class _Up, __enable_if_t<__is_less_than_comparable_v<const _Tp*, const _Up*>, int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(std::__is_valid_range(__begin, __end), "[__begin, __end) is not a valid range");
@@ -47,7 +47,7 @@ __is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
return !__less<>()(__ptr, __begin) && __less<>()(__ptr, __end);
}
-template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable<const _Tp*, const _Up*>::value, int> = 0>
+template <class _Tp, class _Up, __enable_if_t<!__is_less_than_comparable_v<const _Tp*, const _Up*>, int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_SANITIZE("address") bool
__is_pointer_in_range(const _Tp* __begin, const _Tp* __end, const _Up* __ptr) {
if (__libcpp_is_constant_evaluated())
diff --git a/libcxx/include/__vector/vector.h b/libcxx/include/__vector/vector.h
index 4e0d76fbbe3de..8d063f01636f9 100644
--- a/libcxx/include/__vector/vector.h
+++ b/libcxx/include/__vector/vector.h
@@ -174,7 +174,7 @@ class vector {
__guard.__complete();
}
- template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
vector(size_type __n, const value_type& __x, const allocator_type& __a)
: __alloc_(__a) {
@@ -817,20 +817,20 @@ class vector {
template <class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
vector(_InputIterator, _InputIterator) -> vector<__iter_value_type<_InputIterator>, _Alloc>;
template <class _InputIterator,
class _Alloc,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
vector(_InputIterator, _InputIterator, _Alloc) -> vector<__iter_value_type<_InputIterator>, _Alloc>;
#endif
#if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range,
class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector<ranges::range_value_t<_Range>, _Alloc>;
#endif
diff --git a/libcxx/include/any b/libcxx/include/any
index 940cd2939748e..04b9acd973d02 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -204,10 +204,10 @@ public:
__other.__call(_Action::_Move, this);
}
- template < class _ValueType,
- class _Tp = decay_t<_ValueType>,
- class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value &&
- is_copy_constructible<_Tp>::value> >
+ template <
+ class _ValueType,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<!is_same_v<_Tp, any> && !__is_in_place_type_v<_ValueType> && is_copy_constructible_v<_Tp>>>
_LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value);
template <class _ValueType,
diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar
index 8b940b887d25f..d41af176f74fd 100644
--- a/libcxx/include/cwchar
+++ b/libcxx/include/cwchar
@@ -231,8 +231,8 @@ __constexpr_wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __count)
template <class _Tp, class _Up>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp* __str, _Up __value, size_t __count) {
- static_assert(sizeof(_Tp) == sizeof(wchar_t)&& _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t) &&
- __libcpp_is_trivially_equality_comparable<_Tp, _Tp>::value,
+ static_assert(sizeof(_Tp) == sizeof(wchar_t) && _LIBCPP_ALIGNOF(_Tp) >= _LIBCPP_ALIGNOF(wchar_t) &&
+ __is_trivially_equality_comparable_v<_Tp, _Tp>,
"Calling wmemchr on non-trivially equality comparable types is unsafe.");
# if __has_builtin(__builtin_wmemchr)
diff --git a/libcxx/include/deque b/libcxx/include/deque
index d8645d06ae59e..8149074b7bf42 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -635,7 +635,7 @@ public:
# endif
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
- template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a)
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
__annotate_new(0);
@@ -1258,20 +1258,20 @@ _LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque
template <class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
deque(_InputIterator, _InputIterator) -> deque<__iter_value_type<_InputIterator>, _Alloc>;
template <class _InputIterator,
class _Alloc,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
deque(_InputIterator, _InputIterator, _Alloc) -> deque<__iter_value_type<_InputIterator>, _Alloc>;
# endif
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range,
class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque<ranges::range_value_t<_Range>, _Alloc>;
# endif
diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index 6a7f8ae9c4595..f58427805aa1d 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -149,6 +149,12 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS_V2
template <class _Tp>
class propagate_const;
+template <class _Up>
+inline constexpr bool __is_propagate_const_v = false;
+
+template <class _Up>
+inline constexpr bool __is_propagate_const_v<propagate_const<_Up>> = true;
+
template <class _Up>
inline _LIBCPP_HIDE_FROM_ABI constexpr const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
@@ -188,12 +194,6 @@ private:
return __get_pointer(__u.get());
}
- template <class _Up>
- struct __is_propagate_const : false_type {};
-
- template <class _Up>
- struct __is_propagate_const<propagate_const<_Up>> : true_type {};
-
_Tp __t_;
public:
@@ -220,13 +220,13 @@ public:
template <class _Up,
enable_if_t<!is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value &&
- !__is_propagate_const<decay_t<_Up>>::value,
+ !__is_propagate_const_v<decay_t<_Up>>,
bool> = true>
explicit _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {}
template <class _Up,
enable_if_t<is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value &&
- !__is_propagate_const<decay_t<_Up>>::value,
+ !__is_propagate_const_v<decay_t<_Up>>,
bool> = false>
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {}
@@ -240,7 +240,7 @@ public:
return *this;
}
- template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
+ template <class _Up, class _Vp = enable_if_t<!__is_propagate_const_v<decay_t<_Up>>>>
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(_Up&& __u) {
__t_ = std::forward<_Up>(__u);
return *this;
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index f264f567c9bb3..99725130a336e 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -681,7 +681,7 @@ public:
# endif
_LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v);
- template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
_LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : __base(__a) {
insert_after(cbefore_begin(), __n, __v);
}
@@ -888,20 +888,20 @@ private:
template <class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
forward_list(_InputIterator, _InputIterator) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
template <class _InputIterator,
class _Alloc,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
forward_list(_InputIterator, _InputIterator, _Alloc) -> forward_list<__iter_value_type<_InputIterator>, _Alloc>;
# endif
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range,
class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
forward_list(from_range_t, _Range&&, _Alloc = _Alloc()) -> forward_list<ranges::range_value_t<_Range>, _Alloc>;
# endif
diff --git a/libcxx/include/list b/libcxx/include/list
index d1da347b9bd13..73ad6a780dbbb 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -693,7 +693,7 @@ public:
_LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a);
# endif
_LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x);
- template <__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
_LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x, const allocator_type& __a) : __base(__a) {
for (; __n > 0; --__n)
push_back(__x);
@@ -930,20 +930,20 @@ private:
template <class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
list(_InputIterator, _InputIterator) -> list<__iter_value_type<_InputIterator>, _Alloc>;
template <class _InputIterator,
class _Alloc,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
list(_InputIterator, _InputIterator, _Alloc) -> list<__iter_value_type<_InputIterator>, _Alloc>;
# endif
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range,
class _Alloc = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Alloc>::value> >
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
list(from_range_t, _Range&&, _Alloc = _Alloc()) -> list<ranges::range_value_t<_Range>, _Alloc>;
# endif
diff --git a/libcxx/include/map b/libcxx/include/map
index a244696295fb8..abd64278b9a1a 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -1458,8 +1458,8 @@ template <class _InputIterator,
class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
@@ -1467,8 +1467,8 @@ map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat
template <ranges::input_range _Range,
class _Compare = less<__range_key_type<_Range>>,
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
-> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
# endif
@@ -1477,8 +1477,8 @@ template <class _Key,
class _Tp,
class _Compare = less<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
map(initializer_list<pair<_Key, _Tp>>,
_Compare = _Compare(),
_Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
@@ -1486,7 +1486,7 @@ map(initializer_list<pair<_Key, _Tp>>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
map(_InputIterator, _InputIterator, _Allocator)
-> map<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -1494,12 +1494,12 @@ map(_InputIterator, _InputIterator, _Allocator)
_Allocator>;
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
map(from_range_t, _Range&&, _Allocator)
-> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
# endif
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
map(initializer_list<pair<_Key, _Tp>>,
_Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
# endif
@@ -2047,8 +2047,8 @@ template <class _InputIterator,
class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
@@ -2056,8 +2056,8 @@ multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al
template <ranges::input_range _Range,
class _Compare = less<__range_key_type<_Range>>,
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
-> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
# endif
@@ -2066,8 +2066,8 @@ template <class _Key,
class _Tp,
class _Compare = less<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(initializer_list<pair<_Key, _Tp>>,
_Compare = _Compare(),
_Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
@@ -2075,7 +2075,7 @@ multimap(initializer_list<pair<_Key, _Tp>>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(_InputIterator, _InputIterator, _Allocator)
-> multimap<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -2083,12 +2083,12 @@ multimap(_InputIterator, _InputIterator, _Allocator)
_Allocator>;
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(from_range_t, _Range&&, _Allocator)
-> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
# endif
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
multimap(initializer_list<pair<_Key, _Tp>>,
_Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
# endif
diff --git a/libcxx/include/optional b/libcxx/include/optional
index 2153efb2ab899..2347fc45694be 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -575,9 +575,9 @@ concept __is_derived_from_optional = requires(const _Tp& __t) { []<class _Up>(co
# endif // _LIBCPP_STD_VER >= 20
template <class _Tp>
-struct __is_std_optional : false_type {};
+inline constexpr bool __is_std_optional_v = false;
template <class _Tp>
-struct __is_std_optional<optional<_Tp>> : true_type {};
+inline constexpr bool __is_std_optional_v<optional<_Tp>> = true;
template <class _Tp>
class _LIBCPP_DECLSPEC_EMPTY_BASES optional
@@ -617,10 +617,10 @@ private:
};
template <class _Up>
using _CheckOptionalArgsCtor _LIBCPP_NODEBUG =
- _If< _IsNotSame<__remove_cvref_t<_Up>, in_place_t>::value && _IsNotSame<__remove_cvref_t<_Up>, optional>::value &&
- (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_optional<__remove_cvref_t<_Up>>::value),
- _CheckOptionalArgsConstructor,
- __check_tuple_constructor_fail >;
+ _If<_IsNotSame<__remove_cvref_t<_Up>, in_place_t>::value && _IsNotSame<__remove_cvref_t<_Up>, optional>::value &&
+ (!is_same_v<remove_cv_t<_Tp>, bool> || !__is_std_optional_v<__remove_cvref_t<_Up>>),
+ _CheckOptionalArgsConstructor,
+ __check_tuple_constructor_fail>;
template <class _QualUp>
struct _CheckOptionalLikeConstructor {
template <class _Up, class _Opt = optional<_Up>>
@@ -869,8 +869,8 @@ public:
template <class _Func>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr auto and_then(_Func&& __f) & {
using _Up = invoke_result_t<_Func, value_type&>;
- static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
- "Result of f(value()) must be a specialization of std::optional");
+ static_assert(
+ __is_std_optional_v<remove_cvref_t<_Up>>, "Result of f(value()) must be a specialization of std::optional");
if (*this)
return std::invoke(std::forward<_Func>(__f), value());
return remove_cvref_t<_Up>();
@@ -879,8 +879,8 @@ public:
template <class _Func>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr auto and_then(_Func&& __f) const& {
using _Up = invoke_result_t<_Func, const value_type&>;
- static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
- "Result of f(value()) must be a specialization of std::optional");
+ static_assert(
+ __is_std_optional_v<remove_cvref_t<_Up>>, "Result of f(value()) must be a specialization of std::optional");
if (*this)
return std::invoke(std::forward<_Func>(__f), value());
return remove_cvref_t<_Up>();
@@ -889,7 +889,7 @@ public:
template <class _Func>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr auto and_then(_Func&& __f) && {
using _Up = invoke_result_t<_Func, value_type&&>;
- static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
+ static_assert(__is_std_optional_v<remove_cvref_t<_Up>>,
"Result of f(std::move(value())) must be a specialization of std::optional");
if (*this)
return std::invoke(std::forward<_Func>(__f), std::move(value()));
@@ -899,7 +899,7 @@ public:
template <class _Func>
_LIBCPP_HIDE_FROM_ABI constexpr auto and_then(_Func&& __f) const&& {
using _Up = invoke_result_t<_Func, const value_type&&>;
- static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
+ static_assert(__is_std_optional_v<remove_cvref_t<_Up>>,
"Result of f(std::move(value())) must be a specialization of std::optional");
if (*this)
return std::invoke(std::forward<_Func>(__f), std::move(value()));
diff --git a/libcxx/include/queue b/libcxx/include/queue
index 7043a84390d02..936cdbc50c216 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -437,12 +437,12 @@ public:
};
# if _LIBCPP_STD_VER >= 17
-template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >
+template <class _Container, class = enable_if_t<!__is_allocator_v<_Container>>>
queue(_Container) -> queue<typename _Container::value_type, _Container>;
template <class _Container,
class _Alloc,
- class = enable_if_t<!__is_allocator<_Container>::value>,
+ class = enable_if_t<!__is_allocator_v<_Container>>,
class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
queue(_Container, _Alloc) -> queue<typename _Container::value_type, _Container>;
# endif
@@ -457,12 +457,12 @@ queue(from_range_t, _Range&&) -> queue<ranges::range_value_t<_Range>>;
template <class _InputIterator,
class _Alloc,
__enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+ __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
queue(_InputIterator,
_InputIterator,
_Alloc) -> queue<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
-template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
queue(from_range_t,
_Range&&,
_Alloc) -> queue<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
@@ -691,31 +691,31 @@ public:
# if _LIBCPP_STD_VER >= 17
template <class _Compare,
class _Container,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value> >
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<!__is_allocator_v<_Container>>>
priority_queue(_Compare, _Container) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
template <class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Container = vector<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value> >
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<!__is_allocator_v<_Container>>>
priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container())
-> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>;
template <class _Compare,
class _Container,
class _Alloc,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<!__is_allocator_v<_Container>>,
class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
priority_queue(_Compare, _Container, _Alloc) -> priority_queue<typename _Container::value_type, _Container, _Compare>;
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
priority_queue(_InputIterator, _InputIterator, _Allocator)
-> priority_queue<__iter_value_type<_InputIterator>,
vector<__iter_value_type<_InputIterator>, _Allocator>,
@@ -725,8 +725,8 @@ template <class _InputIterator,
class _Compare,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
priority_queue(_InputIterator, _InputIterator, _Compare, _Allocator)
-> priority_queue<__iter_value_type<_InputIterator>,
vector<__iter_value_type<_InputIterator>, _Allocator>,
@@ -737,8 +737,8 @@ template <class _InputIterator,
class _Container,
class _Alloc,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<!__is_allocator<_Container>::value>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<!__is_allocator_v<_Container>>,
class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
@@ -748,19 +748,19 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc)
template <ranges::input_range _Range,
class _Compare = less<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Compare>::value>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
priority_queue(from_range_t, _Range&&, _Compare = _Compare())
-> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>>, _Compare>;
template <ranges::input_range _Range,
class _Compare,
class _Alloc,
- class = enable_if_t<!__is_allocator<_Compare>::value>,
- class = enable_if_t<__is_allocator<_Alloc>::value>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Alloc>>>
priority_queue(from_range_t, _Range&&, _Compare, _Alloc)
-> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>, _Compare>;
-template <ranges::input_range _Range, class _Alloc, class = enable_if_t<__is_allocator<_Alloc>::value>>
+template <ranges::input_range _Range, class _Alloc, class = enable_if_t<__is_allocator_v<_Alloc>>>
priority_queue(from_range_t, _Range&&, _Alloc)
-> priority_queue<ranges::range_value_t<_Range>, vector<ranges::range_value_t<_Range>, _Alloc>>;
diff --git a/libcxx/include/set b/libcxx/include/set
index 83c8ed59065c9..45e40d314146b 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -907,8 +907,8 @@ template <class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
@@ -916,8 +916,8 @@ set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat
template <ranges::input_range _Range,
class _Compare = less<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
-> set<ranges::range_value_t<_Range>, _Compare, _Allocator>;
# endif
@@ -925,26 +925,26 @@ set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
template <class _Key,
class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<!__is_allocator_v<_Compare>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> set<_Key, _Compare, _Allocator>;
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
set(_InputIterator,
_InputIterator,
_Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
set(from_range_t,
_Range&&,
_Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
# endif
-template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <class _Key, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
set(initializer_list<_Key>, _Allocator) -> set<_Key, less<_Key>, _Allocator>;
# endif
@@ -1374,8 +1374,8 @@ template <class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
-> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>;
@@ -1383,8 +1383,8 @@ multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al
template <ranges::input_range _Range,
class _Compare = less<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
-> multiset<ranges::range_value_t<_Range>, _Compare, _Allocator>;
# endif
@@ -1392,8 +1392,8 @@ multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(
template <class _Key,
class _Compare = less<_Key>,
class _Allocator = allocator<_Key>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>,
- class = enable_if_t<!__is_allocator<_Compare>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
+ class = enable_if_t<!__is_allocator_v<_Compare>>>
multiset(initializer_list<_Key>,
_Compare = _Compare(),
_Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>;
@@ -1401,18 +1401,18 @@ multiset(initializer_list<_Key>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
- class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
multiset(_InputIterator, _InputIterator, _Allocator)
-> multiset<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
multiset(from_range_t,
_Range&&,
_Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
# endif
-template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
+template <class _Key, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>;
# endif
diff --git a/libcxx/include/span b/libcxx/include/span
index 3d4f9e4ba7831..718914012c1de 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -203,14 +203,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20
template <class _Tp>
-struct __is_std_span : false_type {};
+inline constexpr bool __is_std_span_v = false;
template <class _Tp, size_t _Sz>
-struct __is_std_span<span<_Tp, _Sz>> : true_type {};
+inline constexpr bool __is_std_span_v<span<_Tp, _Sz>> = true;
template <class _Range, class _ElementType>
concept __span_compatible_range =
- !__is_std_span<remove_cvref_t<_Range>>::value && //
+ !__is_std_span_v<remove_cvref_t<_Range>> && //
ranges::contiguous_range<_Range> && //
ranges::sized_range<_Range> && //
(ranges::borrowed_range<_Range> || is_const_v<_ElementType>) && //
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index 8462f75853408..1b6b1127e4001 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -484,7 +484,7 @@ public:
# if _LIBCPP_STD_VER >= 20
template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
+ requires __is_allocator_v<_SAlloc>
_LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa);
}
@@ -963,7 +963,7 @@ public:
# if _LIBCPP_STD_VER >= 20
template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
+ requires __is_allocator_v<_SAlloc>
_LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
return __sb_.str(__sa);
}
@@ -1101,7 +1101,7 @@ public:
# if _LIBCPP_STD_VER >= 20
template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
+ requires __is_allocator_v<_SAlloc>
_LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
return __sb_.str(__sa);
}
@@ -1241,7 +1241,7 @@ public:
# if _LIBCPP_STD_VER >= 20
template <class _SAlloc>
- requires __is_allocator<_SAlloc>::value
+ requires __is_allocator_v<_SAlloc>
_LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
return __sb_.str(__sa);
}
diff --git a/libcxx/include/stack b/libcxx/include/stack
index 19d09373e23d1..ec3de2d4f040a 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -294,12 +294,12 @@ public:
};
# if _LIBCPP_STD_VER >= 17
-template <class _Container, class = enable_if_t<!__is_allocator<_Container>::value> >
+template <class _Container, class = enable_if_t<!__is_allocator_v<_Container>> >
stack(_Container) -> stack<typename _Container::value_type, _Container>;
template <class _Container,
class _Alloc,
- class = enable_if_t<!__is_allocator<_Container>::value>,
+ class = enable_if_t<!__is_allocator_v<_Container>>,
class = enable_if_t<uses_allocator<_Container, _Alloc>::value> >
stack(_Container, _Alloc) -> stack<typename _Container::value_type, _Container>;
# endif
@@ -314,12 +314,12 @@ stack(from_range_t, _Range&&) -> stack<ranges::range_value_t<_Range>>;
template <class _InputIterator,
class _Alloc,
__enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
- __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+ __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
stack(_InputIterator,
_InputIterator,
_Alloc) -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
-template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
+template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator_v<_Alloc>, int> = 0>
stack(from_range_t,
_Range&&,
_Alloc) -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
diff --git a/libcxx/include/string b/libcxx/include/string
index 4f05e211919f3..832814e2d6d06 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1047,13 +1047,13 @@ public:
}
# endif // _LIBCPP_CXX03_LANG
- template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s) {
_LIBCPP_ASSERT_NON_NULL(__s != nullptr, "basic_string(const char*) detected nullptr");
__init(__s, traits_type::length(__s));
}
- template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const _CharT* _LIBCPP_DIAGNOSE_NULLPTR __s, const _Allocator& __a)
: __alloc_(__a) {
@@ -1100,7 +1100,7 @@ public:
}
# endif
- template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
+ template <__enable_if_t<__is_allocator_v<_Allocator>, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
: __alloc_(__a) {
__init(__n, __c);
@@ -2502,21 +2502,21 @@ template <class _InputIterator,
class _CharT = __iter_value_type<_InputIterator>,
class _Allocator = allocator<_CharT>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator())
-> basic_string<_CharT, char_traits<_CharT>, _Allocator>;
template <class _CharT,
class _Traits,
class _Allocator = allocator<_CharT>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator())
-> basic_string<_CharT, _Traits, _Allocator>;
template <class _CharT,
class _Traits,
class _Allocator = allocator<_CharT>,
- class = enable_if_t<__is_allocator<_Allocator>::value>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>,
class _Sz = typename allocator_traits<_Allocator>::size_type >
basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator())
-> basic_string<_CharT, _Traits, _Allocator>;
@@ -2525,7 +2525,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<__is_allocator<_Allocator>::value> >
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
-> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;
# endif
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 61c89a0ca73bb..d19ed616cd0da 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -1476,10 +1476,10 @@ template <class _InputIterator,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(_InputIterator,
_InputIterator,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -1493,10 +1493,10 @@ template <ranges::input_range _Range,
class _Hash = hash<__range_key_type<_Range>>,
class _Pred = equal_to<__range_key_type<_Range>>,
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(from_range_t,
_Range&&,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -1511,10 +1511,10 @@ template <class _Key,
class _Hash = hash<remove_const_t<_Key>>,
class _Pred = equal_to<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(initializer_list<pair<_Key, _Tp>>,
typename allocator_traits<_Allocator>::size_type = 0,
_Hash = _Hash(),
@@ -1524,7 +1524,7 @@ unordered_map(initializer_list<pair<_Key, _Tp>>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_map<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -1535,7 +1535,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -1547,9 +1547,9 @@ template <class _InputIterator,
class _Hash,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_map<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -1559,7 +1559,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_map<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -1567,7 +1567,7 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz
equal_to<__range_key_type<_Range>>,
_Allocator>;
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(from_range_t, _Range&&, _Allocator)
-> unordered_map<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -1578,9 +1578,9 @@ unordered_map(from_range_t, _Range&&, _Allocator)
template <ranges::input_range _Range,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_map<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -1590,11 +1590,11 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz
# endif
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> unordered_map<remove_const_t<_Key>, _Tp, hash<remove_const_t<_Key>>, equal_to<remove_const_t<_Key>>, _Allocator>;
@@ -1602,9 +1602,9 @@ template <class _Key,
class _Tp,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_map<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
# endif
@@ -2215,10 +2215,10 @@ template <class _InputIterator,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(_InputIterator,
_InputIterator,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -2236,10 +2236,10 @@ template <ranges::input_range _Range,
class _Hash = hash<__range_key_type<_Range>>,
class _Pred = equal_to<__range_key_type<_Range>>,
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(from_range_t,
_Range&&,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -2254,10 +2254,10 @@ template <class _Key,
class _Hash = hash<remove_const_t<_Key>>,
class _Pred = equal_to<remove_const_t<_Key>>,
class _Allocator = allocator<pair<const _Key, _Tp>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(
initializer_list<pair<_Key, _Tp>>,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -2268,7 +2268,7 @@ unordered_multimap(
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multimap<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -2279,7 +2279,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -2291,9 +2291,9 @@ template <class _InputIterator,
class _Hash,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multimap<__iter_key_type<_InputIterator>,
__iter_mapped_type<_InputIterator>,
@@ -2303,7 +2303,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multimap<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -2311,7 +2311,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>
equal_to<__range_key_type<_Range>>,
_Allocator>;
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(from_range_t, _Range&&, _Allocator)
-> unordered_multimap<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -2322,9 +2322,9 @@ unordered_multimap(from_range_t, _Range&&, _Allocator)
template <ranges::input_range _Range,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multimap<__range_key_type<_Range>,
__range_mapped_type<_Range>,
@@ -2334,7 +2334,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>
# endif
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multimap<remove_const_t<_Key>,
_Tp,
@@ -2342,7 +2342,7 @@ unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<
equal_to<remove_const_t<_Key>>,
_Allocator>;
-template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> unordered_multimap<remove_const_t<_Key>,
_Tp,
@@ -2354,9 +2354,9 @@ template <class _Key,
class _Tp,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multimap(
initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, equal_to<remove_const_t<_Key>>, _Allocator>;
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index e97e6e8042e60..02099cfa2bc7f 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -921,10 +921,10 @@ template <class _InputIterator,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(_InputIterator,
_InputIterator,
typename allocator_traits<_Allocator>::size_type = 0,
@@ -937,10 +937,10 @@ template <ranges::input_range _Range,
class _Hash = hash<ranges::range_value_t<_Range>>,
class _Pred = equal_to<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(
from_range_t,
_Range&&,
@@ -954,10 +954,10 @@ template <class _Tp,
class _Hash = hash<_Tp>,
class _Pred = equal_to<_Tp>,
class _Allocator = allocator<_Tp>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(initializer_list<_Tp>,
typename allocator_traits<_Allocator>::size_type = 0,
_Hash = _Hash(),
@@ -967,7 +967,7 @@ unordered_set(initializer_list<_Tp>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_set<__iter_value_type<_InputIterator>,
hash<__iter_value_type<_InputIterator>>,
@@ -978,22 +978,22 @@ template <class _InputIterator,
class _Hash,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_set<__iter_value_type<_InputIterator>, _Hash, equal_to<__iter_value_type<_InputIterator>>, _Allocator>;
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_set<ranges::range_value_t<_Range>,
hash<ranges::range_value_t<_Range>>,
equal_to<ranges::range_value_t<_Range>>,
_Allocator>;
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(from_range_t, _Range&&, _Allocator)
-> unordered_set<ranges::range_value_t<_Range>,
hash<ranges::range_value_t<_Range>>,
@@ -1003,24 +1003,24 @@ unordered_set(from_range_t, _Range&&, _Allocator)
template <ranges::input_range _Range,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_set<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
# endif
-template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
template <class _Tp,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
# endif
@@ -1528,10 +1528,10 @@ template <class _InputIterator,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(
_InputIterator,
_InputIterator,
@@ -1545,10 +1545,10 @@ template <ranges::input_range _Range,
class _Hash = hash<ranges::range_value_t<_Range>>,
class _Pred = equal_to<ranges::range_value_t<_Range>>,
class _Allocator = allocator<ranges::range_value_t<_Range>>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(
from_range_t,
_Range&&,
@@ -1562,10 +1562,10 @@ template <class _Tp,
class _Hash = hash<_Tp>,
class _Pred = equal_to<_Tp>,
class _Allocator = allocator<_Tp>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<!__is_allocator<_Pred>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<!__is_allocator_v<_Pred>>,
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(initializer_list<_Tp>,
typename allocator_traits<_Allocator>::size_type = 0,
_Hash = _Hash(),
@@ -1575,7 +1575,7 @@ unordered_multiset(initializer_list<_Tp>,
template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multiset<__iter_value_type<_InputIterator>,
hash<__iter_value_type<_InputIterator>>,
@@ -1586,9 +1586,9 @@ template <class _InputIterator,
class _Hash,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multiset<__iter_value_type<_InputIterator>,
_Hash,
@@ -1597,14 +1597,14 @@ unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Al
# if _LIBCPP_STD_VER >= 23
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multiset<ranges::range_value_t<_Range>,
hash<ranges::range_value_t<_Range>>,
equal_to<ranges::range_value_t<_Range>>,
_Allocator>;
-template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(from_range_t, _Range&&, _Allocator)
-> unordered_multiset<ranges::range_value_t<_Range>,
hash<ranges::range_value_t<_Range>>,
@@ -1614,24 +1614,24 @@ unordered_multiset(from_range_t, _Range&&, _Allocator)
template <ranges::input_range _Range,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multiset<ranges::range_value_t<_Range>, _Hash, equal_to<ranges::range_value_t<_Range>>, _Allocator>;
# endif
-template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value>>
+template <class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator)
-> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
template <class _Tp,
class _Hash,
class _Allocator,
- class = enable_if_t<!__is_allocator<_Hash>::value>,
+ class = enable_if_t<!__is_allocator_v<_Hash>>,
class = enable_if_t<!is_integral<_Hash>::value>,
- class = enable_if_t<__is_allocator<_Allocator>::value>>
+ class = enable_if_t<__is_allocator_v<_Allocator>>>
unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator)
-> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
# endif
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 96501caaff041..691634a8d042d 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -727,25 +727,25 @@ template <class _ValExpr>
class __val_expr;
template <class _ValExpr>
-struct __is_val_expr : false_type {};
+inline const bool __is_val_expr_v = false;
template <class _ValExpr>
-struct __is_val_expr<__val_expr<_ValExpr> > : true_type {};
+inline const bool __is_val_expr_v<__val_expr<_ValExpr> > = true;
template <class _Tp>
-struct __is_val_expr<valarray<_Tp> > : true_type {};
+inline const bool __is_val_expr_v<valarray<_Tp> > = true;
template <class _Tp>
-struct __is_val_expr<slice_array<_Tp> > : true_type {};
+inline const bool __is_val_expr_v<slice_array<_Tp> > = true;
template <class _Tp>
-struct __is_val_expr<gslice_array<_Tp> > : true_type {};
+inline const bool __is_val_expr_v<gslice_array<_Tp> > = true;
template <class _Tp>
-struct __is_val_expr<mask_array<_Tp> > : true_type {};
+inline const bool __is_val_expr_v<mask_array<_Tp> > = true;
template <class _Tp>
-struct __is_val_expr<indirect_array<_Tp> > : true_type {};
+inline const bool __is_val_expr_v<indirect_array<_Tp> > = true;
// The functions using a __val_expr access the elements by their index.
// valarray and the libc++ lazy proxies have an operator[]. The
@@ -871,34 +871,34 @@ public:
_LIBCPP_HIDE_FROM_ABI valarray& operator<<=(const value_type& __x);
_LIBCPP_HIDE_FROM_ABI valarray& operator>>=(const value_type& __x);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator*=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator/=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator%=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator+=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator-=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator^=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator|=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator&=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator<<=(const _Expr& __v);
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
_LIBCPP_HIDE_FROM_ABI valarray& operator>>=(const _Expr& __v);
// member functions:
@@ -955,14 +955,12 @@ template <class _Tp, size_t _Size>
valarray(const _Tp (&)[_Size], size_t) -> valarray<_Tp>;
# endif
-template <class _Expr,
- __enable_if_t<__is_val_expr<_Expr>::value && __val_expr_use_member_functions<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr> && __val_expr_use_member_functions<_Expr>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI typename _Expr::value_type __get(const _Expr& __v, size_t __i) {
return __v.__get(__i);
}
-template <class _Expr,
- __enable_if_t<__is_val_expr<_Expr>::value && !__val_expr_use_member_functions<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr> && !__val_expr_use_member_functions<_Expr>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI typename _Expr::value_type __get(const _Expr& __v, size_t __i) {
return __v[__i];
}
@@ -1048,37 +1046,37 @@ private:
size_t __stride_;
public:
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator*=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator/=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator%=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator+=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator-=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator^=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator&=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator|=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator<<=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator>>=(const _Expr& __v) const;
slice_array(slice_array const&) = default;
@@ -1113,7 +1111,7 @@ inline const slice_array<_Tp>& slice_array<_Tp>::operator=(const slice_array& __
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1128,7 +1126,7 @@ inline void slice_array<_Tp>::operator=(const valarray<value_type>& __va) const
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator*=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1136,7 +1134,7 @@ inline void slice_array<_Tp>::operator*=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator/=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1144,7 +1142,7 @@ inline void slice_array<_Tp>::operator/=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator%=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1152,7 +1150,7 @@ inline void slice_array<_Tp>::operator%=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator+=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1160,7 +1158,7 @@ inline void slice_array<_Tp>::operator+=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator-=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1168,7 +1166,7 @@ inline void slice_array<_Tp>::operator-=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator^=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1176,7 +1174,7 @@ inline void slice_array<_Tp>::operator^=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator&=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1184,7 +1182,7 @@ inline void slice_array<_Tp>::operator&=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator|=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1192,7 +1190,7 @@ inline void slice_array<_Tp>::operator|=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator<<=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1200,7 +1198,7 @@ inline void slice_array<_Tp>::operator<<=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void slice_array<_Tp>::operator>>=(const _Expr& __v) const {
value_type* __t = __vp_;
for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
@@ -1277,37 +1275,37 @@ private:
valarray<size_t> __1d_;
public:
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator*=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator/=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator%=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator+=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator-=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator^=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator&=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator|=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator<<=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator>>=(const _Expr& __v) const;
_LIBCPP_HIDE_FROM_ABI const gslice_array& operator=(const gslice_array& __ga) const;
@@ -1336,7 +1334,7 @@ private:
};
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1345,7 +1343,7 @@ inline void gslice_array<_Tp>::operator=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator*=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1354,7 +1352,7 @@ inline void gslice_array<_Tp>::operator*=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator/=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1363,7 +1361,7 @@ inline void gslice_array<_Tp>::operator/=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator%=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1372,7 +1370,7 @@ inline void gslice_array<_Tp>::operator%=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator+=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1381,7 +1379,7 @@ inline void gslice_array<_Tp>::operator+=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator-=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1390,7 +1388,7 @@ inline void gslice_array<_Tp>::operator-=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator^=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1399,7 +1397,7 @@ inline void gslice_array<_Tp>::operator^=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator&=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1408,7 +1406,7 @@ inline void gslice_array<_Tp>::operator&=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator|=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1417,7 +1415,7 @@ inline void gslice_array<_Tp>::operator|=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator<<=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1426,7 +1424,7 @@ inline void gslice_array<_Tp>::operator<<=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void gslice_array<_Tp>::operator>>=(const _Expr& __v) const {
typedef const size_t* _Ip;
size_t __j = 0;
@@ -1462,37 +1460,37 @@ private:
valarray<size_t> __1d_;
public:
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator*=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator/=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator%=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator+=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator-=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator^=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator&=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator|=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator<<=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator>>=(const _Expr& __v) const;
mask_array(const mask_array&) = default;
@@ -1522,7 +1520,7 @@ private:
};
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1530,7 +1528,7 @@ inline void mask_array<_Tp>::operator=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator*=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1538,7 +1536,7 @@ inline void mask_array<_Tp>::operator*=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator/=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1546,7 +1544,7 @@ inline void mask_array<_Tp>::operator/=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator%=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1554,7 +1552,7 @@ inline void mask_array<_Tp>::operator%=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator+=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1562,7 +1560,7 @@ inline void mask_array<_Tp>::operator+=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator-=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1570,7 +1568,7 @@ inline void mask_array<_Tp>::operator-=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator^=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1578,7 +1576,7 @@ inline void mask_array<_Tp>::operator^=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator&=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1586,7 +1584,7 @@ inline void mask_array<_Tp>::operator&=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator|=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1594,7 +1592,7 @@ inline void mask_array<_Tp>::operator|=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator<<=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1602,7 +1600,7 @@ inline void mask_array<_Tp>::operator<<=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void mask_array<_Tp>::operator>>=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1667,37 +1665,37 @@ private:
valarray<size_t> __1d_;
public:
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator*=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator/=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator%=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator+=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator-=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator^=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator&=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator|=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator<<=(const _Expr& __v) const;
- template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+ template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
void _LIBCPP_HIDE_FROM_ABI operator>>=(const _Expr& __v) const;
indirect_array(const indirect_array&) = default;
@@ -1728,7 +1726,7 @@ private:
};
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1736,7 +1734,7 @@ inline void indirect_array<_Tp>::operator=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator*=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1744,7 +1742,7 @@ inline void indirect_array<_Tp>::operator*=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator/=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1752,7 +1750,7 @@ inline void indirect_array<_Tp>::operator/=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator%=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1760,7 +1758,7 @@ inline void indirect_array<_Tp>::operator%=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator+=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1768,7 +1766,7 @@ inline void indirect_array<_Tp>::operator+=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator-=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1776,7 +1774,7 @@ inline void indirect_array<_Tp>::operator-=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator^=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1784,7 +1782,7 @@ inline void indirect_array<_Tp>::operator^=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator&=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1792,7 +1790,7 @@ inline void indirect_array<_Tp>::operator&=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator|=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1800,7 +1798,7 @@ inline void indirect_array<_Tp>::operator|=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator<<=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -1808,7 +1806,7 @@ inline void indirect_array<_Tp>::operator<<=(const _Expr& __v) const {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline void indirect_array<_Tp>::operator>>=(const _Expr& __v) const {
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
@@ -2439,7 +2437,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator>>=(const value_type& __x) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator*=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2448,7 +2446,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator*=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator/=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2457,7 +2455,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator/=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator%=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2466,7 +2464,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator%=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator+=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2475,7 +2473,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator+=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator-=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2484,7 +2482,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator-=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator^=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2493,7 +2491,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator^=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator|=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2502,7 +2500,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator|=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator&=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2511,7 +2509,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator&=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator<<=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2520,7 +2518,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator<<=(const _Expr& __v) {
}
template <class _Tp>
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> >
inline valarray<_Tp>& valarray<_Tp>::operator>>=(const _Expr& __v) {
size_t __i = 0;
for (value_type* __t = __begin_; __t != __end_; ++__t, ++__i)
@@ -2663,9 +2661,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(valarray<_Tp>& __x, valarray<_Tp>& __y) _
__x.swap(__y);
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<multiplies<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator*(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2673,7 +2669,7 @@ operator*(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(multiplies<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator*(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2682,7 +2678,7 @@ operator*(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(multiplies<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<multiplies<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator*(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2691,9 +2687,7 @@ operator*(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(multiplies<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<divides<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator/(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2701,7 +2695,7 @@ operator/(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(divides<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<divides<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator/(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2710,7 +2704,7 @@ operator/(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(divides<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<divides<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator/(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2719,9 +2713,7 @@ operator/(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(divides<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<modulus<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator%(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2729,7 +2721,7 @@ operator%(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(modulus<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<modulus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator%(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2738,7 +2730,7 @@ operator%(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(modulus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<modulus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator%(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2747,9 +2739,7 @@ operator%(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(modulus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<plus<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator+(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2757,7 +2747,7 @@ operator+(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(plus<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<plus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator+(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2766,7 +2756,7 @@ operator+(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(plus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<plus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator+(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2775,9 +2765,7 @@ operator+(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(plus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<minus<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator-(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2785,7 +2773,7 @@ operator-(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(minus<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<minus<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator-(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2794,7 +2782,7 @@ operator-(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(minus<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<minus<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator-(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2803,9 +2791,7 @@ operator-(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(minus<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<bit_xor<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator^(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2813,7 +2799,7 @@ operator^(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(bit_xor<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator^(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2822,7 +2808,7 @@ operator^(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(bit_xor<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator^(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2831,9 +2817,7 @@ operator^(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(bit_xor<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<bit_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator&(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2841,7 +2825,7 @@ operator&(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(bit_and<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator&(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2850,7 +2834,7 @@ operator&(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(bit_and<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator&(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2859,9 +2843,7 @@ operator&(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(bit_and<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<bit_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator|(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2869,7 +2851,7 @@ operator|(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(bit_or<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator|(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2878,7 +2860,7 @@ operator|(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(bit_or<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<bit_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator|(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2887,9 +2869,7 @@ operator|(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(bit_or<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__bit_shift_left<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator<<(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2897,7 +2877,7 @@ operator<<(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr< _BinaryOp<__bit_shift_left<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator<<(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2906,7 +2886,7 @@ operator<<(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr< _BinaryOp<__bit_shift_left<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator<<(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2915,9 +2895,7 @@ operator<<(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__bit_shift_right<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator>>(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2925,7 +2903,7 @@ operator>>(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<
_BinaryOp<__bit_shift_right<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator>>(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2934,7 +2912,7 @@ operator>>(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr< _BinaryOp<__bit_shift_right<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator>>(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2943,9 +2921,7 @@ operator>>(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<logical_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator&&(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2953,7 +2929,7 @@ operator&&(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(logical_and<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator&&(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2962,7 +2938,7 @@ operator&&(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(logical_and<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<logical_and<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator&&(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2971,9 +2947,7 @@ operator&&(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(logical_and<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<logical_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator||(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -2981,7 +2955,7 @@ operator||(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(logical_or<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator||(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -2990,7 +2964,7 @@ operator||(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(logical_or<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<logical_or<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator||(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -2999,9 +2973,7 @@ operator||(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(logical_or<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator==(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3009,7 +2981,7 @@ operator==(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(equal_to<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator==(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3018,7 +2990,7 @@ operator==(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(equal_to<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator==(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3027,9 +2999,7 @@ operator==(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(equal_to<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<not_equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator!=(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3037,7 +3007,7 @@ operator!=(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator!=(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3046,7 +3016,7 @@ operator!=(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator!=(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3055,9 +3025,7 @@ operator!=(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<less<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator<(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3065,7 +3033,7 @@ operator<(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(less<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<less<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator<(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3074,7 +3042,7 @@ operator<(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(less<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<less<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator<(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3083,9 +3051,7 @@ operator<(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(less<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<greater<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator>(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3093,7 +3059,7 @@ operator>(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(greater<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<greater<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator>(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3102,7 +3068,7 @@ operator>(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(greater<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<greater<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator>(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3111,9 +3077,7 @@ operator>(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(greater<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<less_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator<=(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3121,7 +3085,7 @@ operator<=(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(less_equal<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator<=(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3130,7 +3094,7 @@ operator<=(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(less_equal<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<less_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator<=(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3139,9 +3103,7 @@ operator<=(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(less_equal<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<greater_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
operator>=(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3149,7 +3111,7 @@ operator>=(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(greater_equal<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
operator>=(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3158,7 +3120,7 @@ operator>=(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(greater_equal<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
operator>=(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3167,7 +3129,7 @@ operator>=(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(greater_equal<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >
abs(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3175,7 +3137,7 @@ abs(const _Expr& __x) {
return __val_expr<_Op>(_Op(__abs_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >
acos(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3183,7 +3145,7 @@ acos(const _Expr& __x) {
return __val_expr<_Op>(_Op(__acos_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >
asin(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3191,7 +3153,7 @@ asin(const _Expr& __x) {
return __val_expr<_Op>(_Op(__asin_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >
atan(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3201,7 +3163,7 @@ atan(const _Expr& __x) {
template <class _Expr1,
class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+ __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__atan2_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
atan2(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3209,7 +3171,7 @@ atan2(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
atan2(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3218,7 +3180,7 @@ atan2(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
atan2(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3227,7 +3189,7 @@ atan2(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >
cos(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3235,7 +3197,7 @@ cos(const _Expr& __x) {
return __val_expr<_Op>(_Op(__cos_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >
cosh(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3243,7 +3205,7 @@ cosh(const _Expr& __x) {
return __val_expr<_Op>(_Op(__cosh_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >
exp(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3251,7 +3213,7 @@ exp(const _Expr& __x) {
return __val_expr<_Op>(_Op(__exp_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >
log(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3259,7 +3221,7 @@ log(const _Expr& __x) {
return __val_expr<_Op>(_Op(__log_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >
log10(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3267,9 +3229,7 @@ log10(const _Expr& __x) {
return __val_expr<_Op>(_Op(__log10_expr<value_type>(), __x));
}
-template <class _Expr1,
- class _Expr2,
- __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
+template <class _Expr1, class _Expr2, __enable_if_t<__is_val_expr_v<_Expr1> && __is_val_expr_v<_Expr2>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_BinaryOp<__pow_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
pow(const _Expr1& __x, const _Expr2& __y) {
typedef typename _Expr1::value_type value_type;
@@ -3277,7 +3237,7 @@ pow(const _Expr1& __x, const _Expr2& __y) {
return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, _Expr, __scalar_expr<typename _Expr::value_type> > >
pow(const _Expr& __x, const typename _Expr::value_type& __y) {
@@ -3286,7 +3246,7 @@ pow(const _Expr& __x, const typename _Expr::value_type& __y) {
return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __scalar_expr<value_type>(__y, __x.size())));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI
__val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>, __scalar_expr<typename _Expr::value_type>, _Expr> >
pow(const typename _Expr::value_type& __x, const _Expr& __y) {
@@ -3295,7 +3255,7 @@ pow(const typename _Expr::value_type& __x, const _Expr& __y) {
return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __scalar_expr<value_type>(__x, __y.size()), __y));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sin_expr<typename _Expr::value_type>, _Expr> >
sin(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3303,7 +3263,7 @@ sin(const _Expr& __x) {
return __val_expr<_Op>(_Op(__sin_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sinh_expr<typename _Expr::value_type>, _Expr> >
sinh(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3311,7 +3271,7 @@ sinh(const _Expr& __x) {
return __val_expr<_Op>(_Op(__sinh_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__sqrt_expr<typename _Expr::value_type>, _Expr> >
sqrt(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3319,7 +3279,7 @@ sqrt(const _Expr& __x) {
return __val_expr<_Op>(_Op(__sqrt_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tan_expr<typename _Expr::value_type>, _Expr> >
tan(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
@@ -3327,7 +3287,7 @@ tan(const _Expr& __x) {
return __val_expr<_Op>(_Op(__tan_expr<value_type>(), __x));
}
-template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+template <class _Expr, __enable_if_t<__is_val_expr_v<_Expr>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI __val_expr<_UnaryOp<__tanh_expr<typename _Expr::value_type>, _Expr> >
tanh(const _Expr& __x) {
typedef typename _Expr::value_type value_type;
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 23d876f9a60af..cbdd9982a58e5 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -1185,9 +1185,9 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr variant(variant&&) = default;
template < class _Arg,
- enable_if_t<!is_same_v<__remove_cvref_t<_Arg>, variant>, int> = 0,
- enable_if_t<!__is_inplace_type<__remove_cvref_t<_Arg>>::value, int> = 0,
- enable_if_t<!__is_inplace_index<__remove_cvref_t<_Arg>>::value, int> = 0,
+ enable_if_t<!is_same_v<__remove_cvref_t<_Arg>, variant>, int> = 0,
+ enable_if_t<!__is_in_place_type_v<__remove_cvref_t<_Arg>>, int> = 0,
+ enable_if_t<!__is_in_place_index_v<__remove_cvref_t<_Arg>>, int> = 0,
class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
enable_if_t<is_constructible_v<_Tp, _Arg>, int> = 0>
diff --git a/libcxx/test/libcxx/memory/is_allocator.pass.cpp b/libcxx/test/libcxx/memory/is_allocator.pass.cpp
index cf11d077bf086..3af39b3eb23cb 100644
--- a/libcxx/test/libcxx/memory/is_allocator.pass.cpp
+++ b/libcxx/test/libcxx/memory/is_allocator.pass.cpp
@@ -23,15 +23,13 @@
#include "test_allocator.h"
template <typename T>
-void test_allocators()
-{
- static_assert(!std::__is_allocator<T>::value, "" );
- static_assert( std::__is_allocator<std::allocator<T>>::value, "" );
- static_assert( std::__is_allocator<test_allocator<T>>::value, "" );
- static_assert( std::__is_allocator<min_allocator<T>>::value, "" );
+void test_allocators() {
+ static_assert(!std::__is_allocator_v<T>, "");
+ static_assert(std::__is_allocator_v<std::allocator<T>>, "");
+ static_assert(std::__is_allocator_v<test_allocator<T>>, "");
+ static_assert(std::__is_allocator_v<min_allocator<T>>, "");
}
-
int main(int, char**)
{
// test_allocators<void>();
diff --git a/libcxx/test/libcxx/type_traits/is_callable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_callable.compile.pass.cpp
index d7bd701aa706a..2eff784b12aef 100644
--- a/libcxx/test/libcxx/type_traits/is_callable.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_callable.compile.pass.cpp
@@ -22,10 +22,9 @@ struct ArgumentFunctor {
bool operator()(int, int);
};
-static_assert(std::__is_callable<Functor>::value, "");
-static_assert(std::__is_callable<decltype(func)>::value, "");
-static_assert(!std::__is_callable<NotFunctor>::value, "");
-static_assert(!std::__is_callable<NotFunctor,
- decltype(&NotFunctor::compare)>::value, "");
-static_assert(std::__is_callable<ArgumentFunctor, int, int>::value, "");
-static_assert(!std::__is_callable<ArgumentFunctor, int>::value, "");
+static_assert(std::__is_callable_v<Functor>, "");
+static_assert(std::__is_callable_v<decltype(func)>, "");
+static_assert(!std::__is_callable_v<NotFunctor>, "");
+static_assert(!std::__is_callable_v<NotFunctor, decltype(&NotFunctor::compare)>, "");
+static_assert(std::__is_callable_v<ArgumentFunctor, int, int>, "");
+static_assert(!std::__is_callable_v<ArgumentFunctor, int>, "");
diff --git a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
index e9b53080fcd6d..ef5710720f6dc 100644
--- a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
@@ -16,38 +16,38 @@
enum Enum : int {};
enum class EnumClass : int {};
-static_assert(std::__libcpp_is_trivially_equality_comparable<int, int>::value, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<const int, int>::value, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<int, const int>::value, "");
+static_assert(std::__is_trivially_equality_comparable_v<int, int>, "");
+static_assert(std::__is_trivially_equality_comparable_v<const int, int>, "");
+static_assert(std::__is_trivially_equality_comparable_v<int, const int>, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<unsigned int, unsigned int>::value, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<const unsigned int, unsigned int>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<unsigned int, int>::value, "");
+static_assert(std::__is_trivially_equality_comparable_v<unsigned int, unsigned int>, "");
+static_assert(std::__is_trivially_equality_comparable_v<const unsigned int, unsigned int>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<unsigned int, int>, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<std::int32_t, std::int64_t>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<std::int64_t, std::int32_t>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<std::int32_t, std::int64_t>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<std::int64_t, std::int32_t>, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<int*, int*>::value, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<int*, void*>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<int*, long*>::value, "");
+static_assert(std::__is_trivially_equality_comparable_v<int*, int*>, "");
+static_assert(std::__is_trivially_equality_comparable_v<int*, void*>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<int*, long*>, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<Enum, int>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<EnumClass, int>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<Enum, int>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<EnumClass, int>, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<float, int>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<double, long long>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<float, int>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<double, long long>, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<float, int>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<float, int>, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<float, float>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<double, double>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<long double, long double>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<float, float>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<double, double>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<long double, long double>, "");
-static_assert(std::__libcpp_is_trivially_equality_comparable<
+static_assert(std::__is_trivially_equality_comparable_v<
char,
- typename std::conditional<std::is_signed<char>::value, signed char, unsigned char>::type>::value,
+ typename std::conditional<std::is_signed<char>::value, signed char, unsigned char>::type>,
"");
-static_assert(std::__libcpp_is_trivially_equality_comparable<char16_t, std::uint_least16_t>::value, "");
+static_assert(std::__is_trivially_equality_comparable_v<char16_t, std::uint_least16_t>, "");
struct S {
char c;
@@ -60,8 +60,8 @@ struct S2 {
struct VirtualBase : virtual S {};
struct NonVirtualBase : S, S2 {};
-static_assert(!std::__libcpp_is_trivially_equality_comparable<S*, VirtualBase*>::value, "");
-static_assert(!std::__libcpp_is_trivially_equality_comparable<S2*, VirtualBase*>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<S*, VirtualBase*>, "");
+static_assert(!std::__is_trivially_equality_comparable_v<S2*, VirtualBase*>, "");
// This is trivially_equality_comparable, but we can't detect it currently
-static_assert(!std::__libcpp_is_trivially_equality_comparable<S*, NonVirtualBase*>::value, "");
+static_assert(!std::__is_trivially_equality_comparable_v<S*, NonVirtualBase*>, "");
diff --git a/libcxx/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp b/libcxx/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp
index e26f5159603f1..c1439f795046e 100644
--- a/libcxx/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/__is_inplace_index.pass.cpp
@@ -18,20 +18,20 @@ struct S {};
int main(int, char**) {
using I = std::in_place_index_t<0>;
- static_assert( std::__is_inplace_index<I>::value, "");
- static_assert( std::__is_inplace_index<const I>::value, "");
- static_assert( std::__is_inplace_index<const volatile I>::value, "");
- static_assert( std::__is_inplace_index<I&>::value, "");
- static_assert( std::__is_inplace_index<const I&>::value, "");
- static_assert( std::__is_inplace_index<const volatile I&>::value, "");
- static_assert( std::__is_inplace_index<I&&>::value, "");
- static_assert( std::__is_inplace_index<const I&&>::value, "");
- static_assert( std::__is_inplace_index<const volatile I&&>::value, "");
- static_assert(!std::__is_inplace_index<std::in_place_type_t<int>>::value, "");
- static_assert(!std::__is_inplace_index<std::in_place_t>::value, "");
- static_assert(!std::__is_inplace_index<void>::value, "");
- static_assert(!std::__is_inplace_index<int>::value, "");
- static_assert(!std::__is_inplace_index<S>::value, "");
+ static_assert( std::__is_in_place_index_v<I>, "");
+ static_assert( std::__is_in_place_index_v<const I>, "");
+ static_assert( std::__is_in_place_index_v<const volatile I>, "");
+ static_assert( std::__is_in_place_index_v<I&>, "");
+ static_assert( std::__is_in_place_index_v<const I&>, "");
+ static_assert( std::__is_in_place_index_v<const volatile I&>, "");
+ static_assert( std::__is_in_place_index_v<I&&>, "");
+ static_assert( std::__is_in_place_index_v<const I&&>, "");
+ static_assert( std::__is_in_place_index_v<const volatile I&&>, "");
+ static_assert(!std::__is_in_place_index_v<std::in_place_type_t<int>>, "");
+ static_assert(!std::__is_in_place_index_v<std::in_place_t>, "");
+ static_assert(!std::__is_in_place_index_v<void>, "");
+ static_assert(!std::__is_in_place_index_v<int>, "");
+ static_assert(!std::__is_in_place_index_v<S>, "");
return 0;
}
diff --git a/libcxx/test/libcxx/utilities/utility/__is_inplace_type.pass.cpp b/libcxx/test/libcxx/utilities/utility/__is_inplace_type.pass.cpp
index 1179067d7d4ca..f5b7575e11239 100644
--- a/libcxx/test/libcxx/utilities/utility/__is_inplace_type.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/__is_inplace_type.pass.cpp
@@ -18,20 +18,20 @@ struct S {};
int main(int, char**) {
using T = std::in_place_type_t<int>;
- static_assert( std::__is_inplace_type<T>::value, "");
- static_assert( std::__is_inplace_type<const T>::value, "");
- static_assert( std::__is_inplace_type<const volatile T>::value, "");
- static_assert( std::__is_inplace_type<T&>::value, "");
- static_assert( std::__is_inplace_type<const T&>::value, "");
- static_assert( std::__is_inplace_type<const volatile T&>::value, "");
- static_assert( std::__is_inplace_type<T&&>::value, "");
- static_assert( std::__is_inplace_type<const T&&>::value, "");
- static_assert( std::__is_inplace_type<const volatile T&&>::value, "");
- static_assert(!std::__is_inplace_type<std::in_place_index_t<0>>::value, "");
- static_assert(!std::__is_inplace_type<std::in_place_t>::value, "");
- static_assert(!std::__is_inplace_type<void>::value, "");
- static_assert(!std::__is_inplace_type<int>::value, "");
- static_assert(!std::__is_inplace_type<S>::value, "");
+ static_assert( std::__is_in_place_type_v<T>, "");
+ static_assert( std::__is_in_place_type_v<const T>, "");
+ static_assert( std::__is_in_place_type_v<const volatile T>, "");
+ static_assert( std::__is_in_place_type_v<T&>, "");
+ static_assert( std::__is_in_place_type_v<const T&>, "");
+ static_assert( std::__is_in_place_type_v<const volatile T&>, "");
+ static_assert( std::__is_in_place_type_v<T&&>, "");
+ static_assert( std::__is_in_place_type_v<const T&&>, "");
+ static_assert( std::__is_in_place_type_v<const volatile T&&>, "");
+ static_assert(!std::__is_in_place_type_v<std::in_place_index_t<0>>, "");
+ static_assert(!std::__is_in_place_type_v<std::in_place_t>, "");
+ static_assert(!std::__is_in_place_type_v<void>, "");
+ static_assert(!std::__is_in_place_type_v<int>, "");
+ static_assert(!std::__is_in_place_type_v<S>, "");
return 0;
}
More information about the libcxx-commits
mailing list