diff --git a/libcxx/include/__flat_map/flat_map.h b/libcxx/include/__flat_map/flat_map.h index bf193f6d3c62f..31ba9bc0b91ac 100644 --- a/libcxx/include/__flat_map/flat_map.h +++ b/libcxx/include/__flat_map/flat_map.h @@ -1125,8 +1125,7 @@ class flat_map { }; template > - 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) @@ -1139,7 +1138,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare = _Compare()) template 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; template - 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) @@ -1162,8 +1160,7 @@ flat_map(_KeyContainer, _MappedContainer, _Compare, _Allocator) _MappedContainer>; template > - 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) @@ -1176,7 +1173,7 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare = _Compare() template 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; template - 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) @@ -1199,19 +1195,19 @@ flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare, _Allocator) _MappedContainer>; template >> - 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 >> - 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 >, class _Allocator = allocator, - class = __enable_if_t::value && __is_allocator<_Allocator>::value>> + class = __enable_if_t && __is_allocator_v<_Allocator>>> flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_map< __range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1219,7 +1215,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 ::value>> +template >> flat_map(from_range_t, _Range&&, _Allocator) -> flat_map< __range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1228,11 +1224,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 > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_map(initializer_list>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>; template > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_map(sorted_unique_t, initializer_list>, _Compare = _Compare()) -> flat_map<_Key, _Tp, _Compare>; template diff --git a/libcxx/include/__flat_map/flat_multimap.h b/libcxx/include/__flat_map/flat_multimap.h index 260d93ed25785..abaacf9e3cda3 100644 --- a/libcxx/include/__flat_map/flat_multimap.h +++ b/libcxx/include/__flat_map/flat_multimap.h @@ -928,8 +928,7 @@ class flat_multimap { }; template > - 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) @@ -942,7 +941,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare = _Compare()) template 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; template - 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) @@ -965,8 +963,7 @@ flat_multimap(_KeyContainer, _MappedContainer, _Compare, _Allocator) _MappedContainer>; template > - 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) @@ -979,7 +976,7 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare = _ template 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; template - 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) @@ -1002,19 +998,19 @@ flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare, _A _MappedContainer>; template >> - 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 >> - 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 >, class _Allocator = allocator, - class = __enable_if_t::value && __is_allocator<_Allocator>::value>> + class = __enable_if_t && __is_allocator_v<_Allocator>>> flat_multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multimap< __range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1022,7 +1018,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 ::value>> +template >> flat_multimap(from_range_t, _Range&&, _Allocator) -> flat_multimap< __range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1031,11 +1027,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 > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_multimap(initializer_list>, _Compare = _Compare()) -> flat_multimap<_Key, _Tp, _Compare>; template > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_multimap(sorted_equivalent_t, initializer_list>, _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 44d8af05a56af..65f4161a8c34c 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 > - requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value && + requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && is_invocable_v) @@ -697,12 +697,12 @@ flat_multiset(_KeyContainer, _Compare = _Compare()) -> flat_multiset; template - 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, _KeyContainer>; template - 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 flat_multiset; template > - requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value && + requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && is_invocable_v) @@ -719,12 +719,12 @@ flat_multiset(sorted_equivalent_t, _KeyContainer, _Compare = _Compare()) -> flat_multiset; template - 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, _KeyContainer>; template - 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 flat_multiset; template >> - 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 >> - 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 >, class _Allocator = allocator>, - class = __enable_if_t::value && __is_allocator<_Allocator>::value>> + class = __enable_if_t && __is_allocator_v<_Allocator>>> flat_multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_multiset< ranges::range_value_t<_Range>, _Compare, vector, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>; -template ::value>> +template >> flat_multiset(from_range_t, _Range&&, _Allocator) -> flat_multiset< ranges::range_value_t<_Range>, less>, vector, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>; template > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_multiset(initializer_list<_Key>, _Compare = _Compare()) -> flat_multiset<_Key, _Compare>; template > - 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 diff --git a/libcxx/include/__flat_set/flat_set.h b/libcxx/include/__flat_set/flat_set.h index 95cb998459bc8..cc788bda544de 100644 --- a/libcxx/include/__flat_set/flat_set.h +++ b/libcxx/include/__flat_set/flat_set.h @@ -774,19 +774,19 @@ class flat_set { }; template > - requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value && + requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && is_invocable_v) flat_set(_KeyContainer, _Compare = _Compare()) -> flat_set; template - 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, _KeyContainer>; template - 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 flat_set(_KeyContainer, _Compare, _Allocator) -> flat_set; template > - requires(!__is_allocator<_Compare>::value && !__is_allocator<_KeyContainer>::value && + requires(!__is_allocator_v<_Compare> && !__is_allocator_v<_KeyContainer> && is_invocable_v) @@ -802,12 +802,12 @@ flat_set(sorted_unique_t, _KeyContainer, _Compare = _Compare()) -> flat_set; template - 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, _KeyContainer>; template - 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 flat_set; template >> - 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 >> - 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 >, class _Allocator = allocator>, - class = __enable_if_t::value && __is_allocator<_Allocator>::value>> + class = __enable_if_t && __is_allocator_v<_Allocator>>> flat_set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_set< ranges::range_value_t<_Range>, _Compare, vector, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>; -template ::value>> +template >> flat_set(from_range_t, _Range&&, _Allocator) -> flat_set< ranges::range_value_t<_Range>, less>, vector, __allocator_traits_rebind_t<_Allocator, ranges::range_value_t<_Range>>>>; template > - requires(!__is_allocator<_Compare>::value) + requires(!__is_allocator_v<_Compare>) flat_set(initializer_list<_Key>, _Compare = _Compare()) -> flat_set<_Key, _Compare>; template > - 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 diff --git a/libcxx/include/__type_traits/is_allocator.h b/libcxx/include/__type_traits/is_allocator.h index 191eeb9a1f522..f37c029a2aa89 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> @@ -21,13 +20,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template -struct __is_allocator : false_type {}; +template +inline const bool __is_allocator_v = false; -template -struct __is_allocator<_Alloc, - __void_t, - __void_t().allocate(size_t(0)))> > : true_type {}; +template +inline const bool __is_allocator_v<_Alloc, + __void_t, + __void_t().allocate(size_t()))> > = true; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__vector/vector.h b/libcxx/include/__vector/vector.h index 27e681aeef22a..7ecd7d7f23b46 100644 --- a/libcxx/include/__vector/vector.h +++ b/libcxx/include/__vector/vector.h @@ -177,7 +177,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) { @@ -847,20 +847,20 @@ class vector { template >, 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 ::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 >, - class = enable_if_t<__is_allocator<_Alloc>::value> > + class = enable_if_t<__is_allocator_v<_Alloc>>> vector(from_range_t, _Range&&, _Alloc = _Alloc()) -> vector, _Alloc>; #endif diff --git a/libcxx/include/deque b/libcxx/include/deque index 98d1dbbddb7e8..cfb64b4f07332 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -637,7 +637,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); @@ -1260,20 +1260,20 @@ _LIBCPP_CONSTEXPR const typename allocator_traits<_Alloc>::difference_type deque template >, 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 ::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 >, - class = enable_if_t<__is_allocator<_Alloc>::value> > + class = enable_if_t<__is_allocator_v<_Alloc>>> deque(from_range_t, _Range&&, _Alloc = _Alloc()) -> deque, _Alloc>; # endif diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index 6daa7fbbc03c2..0a0bfa7a7f037 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -680,7 +680,7 @@ public: # endif _LIBCPP_CONSTEXPR_SINCE_CXX26 _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_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : __base(__a) { @@ -920,20 +920,20 @@ private: template >, 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 ::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 >, - 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, _Alloc>; # endif diff --git a/libcxx/include/list b/libcxx/include/list index 2896231203d9b..5d8067545b9c7 100644 --- a/libcxx/include/list +++ b/libcxx/include/list @@ -724,7 +724,7 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit list(size_type __n, const allocator_type& __a); # endif _LIBCPP_CONSTEXPR_SINCE_CXX26 _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_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI list(size_type __n, const value_type& __x, const allocator_type& __a) : __base(__a) { @@ -1002,20 +1002,20 @@ private: template >, 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 ::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 >, - class = enable_if_t<__is_allocator<_Alloc>::value> > + class = enable_if_t<__is_allocator_v<_Alloc>>> list(from_range_t, _Range&&, _Alloc = _Alloc()) -> list, _Alloc>; # endif diff --git a/libcxx/include/map b/libcxx/include/map index 5f906bb0106c1..a63dfec910aae 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -1332,8 +1332,8 @@ template >, class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + 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>; @@ -1341,8 +1341,8 @@ map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat template >, class _Allocator = allocator<__range_to_alloc_type<_Range>>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + 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 @@ -1351,15 +1351,15 @@ template >, class _Allocator = allocator>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> map(initializer_list>, _Compare = _Compare(), _Allocator = _Allocator()) -> map, _Tp, _Compare, _Allocator>; template ::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>, @@ -1367,12 +1367,12 @@ map(_InputIterator, _InputIterator, _Allocator) _Allocator>; # if _LIBCPP_STD_VER >= 23 -template ::value, void>> +template >> map(from_range_t, _Range&&, _Allocator) -> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>; # endif -template ::value, void>> +template >> map(initializer_list>, _Allocator) -> map, _Tp, less>, _Allocator>; # endif @@ -1889,8 +1889,8 @@ template >, class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + 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>; @@ -1898,8 +1898,8 @@ multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al template >, class _Allocator = allocator<__range_to_alloc_type<_Range>>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + 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 @@ -1908,15 +1908,15 @@ template >, class _Allocator = allocator>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> multimap(initializer_list>, _Compare = _Compare(), _Allocator = _Allocator()) -> multimap, _Tp, _Compare, _Allocator>; template ::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>, @@ -1924,12 +1924,12 @@ multimap(_InputIterator, _InputIterator, _Allocator) _Allocator>; # if _LIBCPP_STD_VER >= 23 -template ::value, void>> +template >> multimap(from_range_t, _Range&&, _Allocator) -> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>; # endif -template ::value, void>> +template >> multimap(initializer_list>, _Allocator) -> multimap, _Tp, less>, _Allocator>; # endif diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in index 63cf8e847751f..5bd3689dabfc9 100644 --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -103,10 +103,7 @@ module std_core [system] { header "__type_traits/is_aggregate.h" export std_core.type_traits.integral_constant } - module is_allocator { - header "__type_traits/is_allocator.h" - export std_core.type_traits.integral_constant - } + module is_allocator { header "__type_traits/is_allocator.h" } module is_always_bitcastable { header "__type_traits/is_always_bitcastable.h" export std_core.type_traits.integral_constant diff --git a/libcxx/include/queue b/libcxx/include/queue index c33afc892dda8..65936250c66a1 100644 --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -437,12 +437,12 @@ public: }; # if _LIBCPP_STD_VER >= 17 -template ::value> > +template >> queue(_Container) -> queue; template ::value>, + class = enable_if_t>, class = enable_if_t::value> > queue(_Container, _Alloc) -> queue; # endif @@ -457,11 +457,11 @@ queue(from_range_t, _Range&&) -> queue>; template ::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 ::value, int> = 0> +template , int> = 0> queue(from_range_t, _Range&&, _Alloc) -> queue, deque, _Alloc>>; # endif @@ -700,31 +700,31 @@ public: # if _LIBCPP_STD_VER >= 17 template ::value>, - class = enable_if_t::value> > + class = enable_if_t>, + class = enable_if_t>> priority_queue(_Compare, _Container) -> priority_queue; template >, class _Container = vector<__iter_value_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t::value>, - class = enable_if_t::value> > + class = enable_if_t>, + class = enable_if_t>> priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container()) -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>; template ::value>, - class = enable_if_t::value>, - class = enable_if_t::value> > + class = enable_if_t>, + class = enable_if_t>, + class = enable_if_t::value>> priority_queue(_Compare, _Container, _Alloc) -> priority_queue; template ::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>, @@ -734,8 +734,8 @@ template ::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value> > + class = enable_if_t>, + 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>, @@ -746,8 +746,8 @@ template ::value>, - class = enable_if_t::value>, - class = enable_if_t::value>, + class = enable_if_t>, + class = enable_if_t>, class = enable_if_t::value> > priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc) -> priority_queue; @@ -757,19 +757,19 @@ priority_queue(_InputIterator, _InputIterator, _Compare, _Container, _Alloc) template >, - class = enable_if_t::value>> + class = enable_if_t>> priority_queue(from_range_t, _Range&&, _Compare = _Compare()) -> priority_queue, vector>, _Compare>; template ::value>, - class = enable_if_t<__is_allocator<_Alloc>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Alloc>>> priority_queue(from_range_t, _Range&&, _Compare, _Alloc) -> priority_queue, vector, _Alloc>, _Compare>; -template ::value>> +template >> priority_queue(from_range_t, _Range&&, _Alloc) -> priority_queue, vector, _Alloc>>; diff --git a/libcxx/include/set b/libcxx/include/set index 81c3de7343ee5..75529e7bac6ff 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -899,8 +899,8 @@ template >, 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::value, void>> + class = enable_if_t<__is_allocator_v<_Allocator>>, + class = enable_if_t>> set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) -> set<__iter_value_type<_InputIterator>, _Compare, _Allocator>; @@ -908,8 +908,8 @@ set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocat template >, class _Allocator = allocator>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>, - class = enable_if_t::value, void>> + class = enable_if_t<__is_allocator_v<_Allocator>>, + class = enable_if_t>> set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> set, _Compare, _Allocator>; # endif @@ -917,24 +917,24 @@ set(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) template , class _Allocator = allocator<_Key>, - class = enable_if_t::value, void>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> set<_Key, _Compare, _Allocator>; template ::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 ::value, void>> +template >> set(from_range_t, _Range&&, _Allocator) -> set, less>, _Allocator>; # endif -template ::value, void>> +template >> set(initializer_list<_Key>, _Allocator) -> set<_Key, less<_Key>, _Allocator>; # endif @@ -1351,8 +1351,8 @@ template >, 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::value, void>> + class = enable_if_t<__is_allocator_v<_Allocator>>, + class = enable_if_t>> multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) -> multiset<__iter_value_type<_InputIterator>, _Compare, _Allocator>; @@ -1360,8 +1360,8 @@ multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Al template >, class _Allocator = allocator>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>, - class = enable_if_t::value, void>> + class = enable_if_t<__is_allocator_v<_Allocator>>, + class = enable_if_t>> multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> multiset, _Compare, _Allocator>; # endif @@ -1369,25 +1369,25 @@ multiset(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator( template , class _Allocator = allocator<_Key>, - class = enable_if_t<__is_allocator<_Allocator>::value, void>, - class = enable_if_t::value, void>> + class = enable_if_t<__is_allocator_v<_Allocator>>, + class = enable_if_t>> multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>; template ::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 ::value, void>> +template >> multiset(from_range_t, _Range&&, _Allocator) -> multiset, less>, _Allocator>; # endif -template ::value, void>> +template >> multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>; # endif diff --git a/libcxx/include/sstream b/libcxx/include/sstream index 682a28fd4dbb8..c42dbff9eee5f 100644 --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -484,7 +484,7 @@ public: # if _LIBCPP_STD_VER >= 20 template - requires __is_allocator<_SAlloc>::value + requires __is_allocator_v<_SAlloc> _LIBCPP_HIDE_FROM_ABI basic_string str(const _SAlloc& __sa) const { return basic_string<_CharT, _Traits, _SAlloc>(view(), __sa); } @@ -963,7 +963,7 @@ public: # if _LIBCPP_STD_VER >= 20 template - requires __is_allocator<_SAlloc>::value + requires __is_allocator_v<_SAlloc> _LIBCPP_HIDE_FROM_ABI basic_string str(const _SAlloc& __sa) const { return __sb_.str(__sa); } @@ -1101,7 +1101,7 @@ public: # if _LIBCPP_STD_VER >= 20 template - requires __is_allocator<_SAlloc>::value + requires __is_allocator_v<_SAlloc> _LIBCPP_HIDE_FROM_ABI basic_string str(const _SAlloc& __sa) const { return __sb_.str(__sa); } @@ -1241,7 +1241,7 @@ public: # if _LIBCPP_STD_VER >= 20 template - requires __is_allocator<_SAlloc>::value + requires __is_allocator_v<_SAlloc> _LIBCPP_HIDE_FROM_ABI basic_string str(const _SAlloc& __sa) const { return __sb_.str(__sa); } diff --git a/libcxx/include/stack b/libcxx/include/stack index 985813fcf578a..3d7187ddb1630 100644 --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -294,12 +294,12 @@ public: }; # if _LIBCPP_STD_VER >= 17 -template ::value> > +template >> stack(_Container) -> stack; template ::value>, + class = enable_if_t>, class = enable_if_t::value> > stack(_Container, _Alloc) -> stack; # endif @@ -314,11 +314,11 @@ stack(from_range_t, _Range&&) -> stack>; template ::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 ::value, int> = 0> +template , int> = 0> stack(from_range_t, _Range&&, _Alloc) -> stack, deque, _Alloc>>; diff --git a/libcxx/include/string b/libcxx/include/string index bbd7b98f112a6..a6f0390964b70 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1059,13 +1059,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) { @@ -1114,7 +1114,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); @@ -2569,21 +2569,21 @@ template , 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 = 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 = 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>; @@ -2592,7 +2592,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _ # if _LIBCPP_STD_VER >= 23 template >, - 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, char_traits>, _Allocator>; # endif diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 43a2245c5acc0..2afc8805cb4c7 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1297,10 +1297,10 @@ template >, class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, @@ -1314,10 +1314,10 @@ template >, class _Pred = equal_to<__range_key_type<_Range>>, class _Allocator = allocator<__range_to_alloc_type<_Range>>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0, @@ -1332,10 +1332,10 @@ template >, class _Pred = equal_to>, class _Allocator = allocator>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_map(initializer_list>, typename allocator_traits<_Allocator>::size_type = 0, _Hash = _Hash(), @@ -1345,7 +1345,7 @@ unordered_map(initializer_list>, template ::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>, @@ -1356,7 +1356,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat template ::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>, @@ -1368,9 +1368,9 @@ template ::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::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>, @@ -1380,7 +1380,7 @@ unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocat # if _LIBCPP_STD_VER >= 23 -template ::value>> +template >> unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1388,7 +1388,7 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz equal_to<__range_key_type<_Range>>, _Allocator>; -template ::value>> +template >> unordered_map(from_range_t, _Range&&, _Allocator) -> unordered_map<__range_key_type<_Range>, __range_mapped_type<_Range>, @@ -1399,9 +1399,9 @@ unordered_map(from_range_t, _Range&&, _Allocator) template ::value>, + class = enable_if_t>, class = enable_if_t::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>, @@ -1411,11 +1411,11 @@ unordered_map(from_range_t, _Range&&, typename allocator_traits<_Allocator>::siz # endif -template ::value>> +template >> unordered_map(initializer_list>, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_map, _Tp, hash>, equal_to>, _Allocator>; -template ::value>> +template >> unordered_map(initializer_list>, _Allocator) -> unordered_map, _Tp, hash>, equal_to>, _Allocator>; @@ -1423,9 +1423,9 @@ template ::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_map(initializer_list>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) -> unordered_map, _Tp, _Hash, equal_to>, _Allocator>; # endif @@ -1992,10 +1992,10 @@ template >, class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, @@ -2013,10 +2013,10 @@ template >, class _Pred = equal_to<__range_key_type<_Range>>, class _Allocator = allocator<__range_to_alloc_type<_Range>>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0, @@ -2031,10 +2031,10 @@ template >, class _Pred = equal_to>, class _Allocator = allocator>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multimap(initializer_list>, typename allocator_traits<_Allocator>::size_type = 0, _Hash = _Hash(), @@ -2045,7 +2045,7 @@ unordered_multimap(initializer_list>, template ::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>, @@ -2056,7 +2056,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al template ::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>, @@ -2068,9 +2068,9 @@ template ::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::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>, @@ -2080,7 +2080,7 @@ unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Al # if _LIBCPP_STD_VER >= 23 -template ::value>> +template >> unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, @@ -2088,7 +2088,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator> equal_to<__range_key_type<_Range>>, _Allocator>; -template ::value>> +template >> unordered_multimap(from_range_t, _Range&&, _Allocator) -> unordered_multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, @@ -2099,9 +2099,9 @@ unordered_multimap(from_range_t, _Range&&, _Allocator) template ::value>, + class = enable_if_t>, class = enable_if_t::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>, @@ -2111,7 +2111,7 @@ unordered_multimap(from_range_t, _Range&&, typename allocator_traits<_Allocator> # endif -template ::value>> +template >> unordered_multimap(initializer_list>, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_multimap, _Tp, @@ -2119,7 +2119,7 @@ unordered_multimap(initializer_list>, typename allocator_traits< equal_to>, _Allocator>; -template ::value>> +template >> unordered_multimap(initializer_list>, _Allocator) -> unordered_multimap, _Tp, @@ -2131,9 +2131,9 @@ template ::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multimap( initializer_list>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) -> unordered_multimap, _Tp, _Hash, equal_to>, _Allocator>; diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set index c6ee0ffdec6af..6b81fc318e3a1 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -917,10 +917,10 @@ template >, class _Allocator = allocator<__iter_value_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, @@ -933,10 +933,10 @@ template >, class _Pred = equal_to>, class _Allocator = allocator>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type = 0, @@ -950,10 +950,10 @@ template , class _Pred = equal_to<_Tp>, class _Allocator = allocator<_Tp>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type = 0, _Hash = _Hash(), @@ -963,7 +963,7 @@ unordered_set(initializer_list<_Tp>, template ::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>>, @@ -974,22 +974,22 @@ template ::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::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 ::value>> +template >> unordered_set(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_set, hash>, equal_to>, _Allocator>; -template ::value>> +template >> unordered_set(from_range_t, _Range&&, _Allocator) -> unordered_set, hash>, @@ -999,24 +999,24 @@ unordered_set(from_range_t, _Range&&, _Allocator) template ::value>, + class = enable_if_t>, class = enable_if_t::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, _Hash, equal_to>, _Allocator>; # endif -template ::value>> +template >> unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; template ::value>, + class = enable_if_t>, class = enable_if_t::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 @@ -1502,10 +1502,10 @@ template >, class _Allocator = allocator<__iter_value_type<_InputIterator>>, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multiset( _InputIterator, _InputIterator, @@ -1519,10 +1519,10 @@ template >, class _Pred = equal_to>, class _Allocator = allocator>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multiset( from_range_t, _Range&&, @@ -1536,10 +1536,10 @@ template , class _Pred = equal_to<_Tp>, class _Allocator = allocator<_Tp>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::value>, - class = enable_if_t::value>, - class = enable_if_t<__is_allocator<_Allocator>::value>> + class = enable_if_t>, + class = enable_if_t<__is_allocator_v<_Allocator>>> unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type = 0, _Hash = _Hash(), @@ -1549,7 +1549,7 @@ unordered_multiset(initializer_list<_Tp>, template ::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>>, @@ -1560,9 +1560,9 @@ template ::value>, - class = enable_if_t::value>, + class = enable_if_t>, class = enable_if_t::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, @@ -1571,14 +1571,14 @@ unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Al # if _LIBCPP_STD_VER >= 23 -template ::value>> +template >> unordered_multiset(from_range_t, _Range&&, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_multiset, hash>, equal_to>, _Allocator>; -template ::value>> +template >> unordered_multiset(from_range_t, _Range&&, _Allocator) -> unordered_multiset, hash>, @@ -1588,24 +1588,24 @@ unordered_multiset(from_range_t, _Range&&, _Allocator) template ::value>, + class = enable_if_t>, class = enable_if_t::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, _Hash, equal_to>, _Allocator>; # endif -template ::value>> +template >> unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator) -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; template ::value>, + class = enable_if_t>, class = enable_if_t::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/test/libcxx/memory/is_allocator.pass.cpp b/libcxx/test/libcxx/memory/is_allocator.pass.cpp index cf11d077bf086..ad01b93a449e1 100644 --- a/libcxx/test/libcxx/memory/is_allocator.pass.cpp +++ b/libcxx/test/libcxx/memory/is_allocator.pass.cpp @@ -11,7 +11,7 @@ // UNSUPPORTED: c++03, c++11, c++14 // template -// struct __is_allocator; +// inline const bool __is_allocator_v; // Is either true_type or false_type depending on if A is an allocator. @@ -23,15 +23,13 @@ #include "test_allocator.h" template -void test_allocators() -{ - static_assert(!std::__is_allocator::value, "" ); - static_assert( std::__is_allocator>::value, "" ); - static_assert( std::__is_allocator>::value, "" ); - static_assert( std::__is_allocator>::value, "" ); +void test_allocators() { + static_assert(!std::__is_allocator_v, ""); + static_assert(std::__is_allocator_v>, ""); + static_assert(std::__is_allocator_v>, ""); + static_assert(std::__is_allocator_v>, ""); } - int main(int, char**) { // test_allocators();