Skip to content

Commit 14a8af7

Browse files
committed
[libc++] Refactor more __enable_ifs to the canonical style
1 parent 7f40c5c commit 14a8af7

30 files changed

+363
-411
lines changed

libcxx/include/__algorithm/search.h

+24-21
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,18 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __searc
117117
}
118118
}
119119

120-
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
120+
template <class _Iter1,
121+
class _Sent1,
122+
class _Iter2,
123+
class _Sent2,
124+
class _Pred,
125+
class _Proj1,
126+
class _Proj2,
127+
__enable_if_t<__has_random_access_iterator_category<_Iter1>::value &&
128+
__has_random_access_iterator_category<_Iter2>::value,
129+
int> = 0>
121130
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __search_impl(
122-
_Iter1 __first1,
123-
_Sent1 __last1,
124-
_Iter2 __first2,
125-
_Sent2 __last2,
126-
_Pred& __pred,
127-
_Proj1& __proj1,
128-
_Proj2& __proj2,
129-
__enable_if_t<__has_random_access_iterator_category<_Iter1>::value &&
130-
__has_random_access_iterator_category<_Iter2>::value>* = nullptr) {
131+
_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
131132
auto __size2 = __last2 - __first2;
132133
if (__size2 == 0)
133134
return std::make_pair(__first1, __first1);
@@ -141,18 +142,20 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __searc
141142
__first1, __last1, __first2, __last2, __pred, __proj1, __proj2, __size1, __size2);
142143
}
143144

144-
template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
145-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __search_impl(
146-
_Iter1 __first1,
147-
_Sent1 __last1,
148-
_Iter2 __first2,
149-
_Sent2 __last2,
150-
_Pred& __pred,
151-
_Proj1& __proj1,
152-
_Proj2& __proj2,
145+
template <
146+
class _Iter1,
147+
class _Sent1,
148+
class _Iter2,
149+
class _Sent2,
150+
class _Pred,
151+
class _Proj1,
152+
class _Proj2,
153153
__enable_if_t<__has_forward_iterator_category<_Iter1>::value && __has_forward_iterator_category<_Iter2>::value &&
154-
!(__has_random_access_iterator_category<_Iter1>::value &&
155-
__has_random_access_iterator_category<_Iter2>::value)>* = nullptr) {
154+
!(__has_random_access_iterator_category<_Iter1>::value &&
155+
__has_random_access_iterator_category<_Iter2>::value),
156+
int> = 0>
157+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __search_impl(
158+
_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
156159
return std::__search_forward_impl<_ClassicAlgPolicy>(__first1, __last1, __first2, __last2, __pred, __proj1, __proj2);
157160
}
158161

libcxx/include/__algorithm/search_n.h

+20-19
Original file line numberDiff line numberDiff line change
@@ -108,29 +108,30 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 std::pair<_Iter, _Iter> __se
108108
}
109109
}
110110

111-
template <class _Iter, class _Sent, class _DiffT, class _Type, class _Pred, class _Proj>
112-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter> __search_n_impl(
113-
_Iter __first,
114-
_Sent __last,
115-
_DiffT __count,
116-
const _Type& __value,
117-
_Pred& __pred,
118-
_Proj& __proj,
119-
__enable_if_t<__has_random_access_iterator_category<_Iter>::value>* = nullptr) {
111+
template <class _Iter,
112+
class _Sent,
113+
class _DiffT,
114+
class _Type,
115+
class _Pred,
116+
class _Proj,
117+
__enable_if_t<__has_random_access_iterator_category<_Iter>::value, int> = 0>
118+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter>
119+
__search_n_impl(_Iter __first, _Sent __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
120120
return std::__search_n_random_access_impl<_ClassicAlgPolicy>(
121121
__first, __last, __count, __value, __pred, __proj, __last - __first);
122122
}
123123

124-
template <class _Iter1, class _Sent1, class _DiffT, class _Type, class _Pred, class _Proj>
125-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1> __search_n_impl(
126-
_Iter1 __first,
127-
_Sent1 __last,
128-
_DiffT __count,
129-
const _Type& __value,
130-
_Pred& __pred,
131-
_Proj& __proj,
132-
__enable_if_t<__has_forward_iterator_category<_Iter1>::value &&
133-
!__has_random_access_iterator_category<_Iter1>::value>* = nullptr) {
124+
template <class _Iter1,
125+
class _Sent1,
126+
class _DiffT,
127+
class _Type,
128+
class _Pred,
129+
class _Proj,
130+
__enable_if_t<__has_forward_iterator_category<_Iter1>::value &&
131+
!__has_random_access_iterator_category<_Iter1>::value,
132+
int> = 0>
133+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter1, _Iter1>
134+
__search_n_impl(_Iter1 __first, _Sent1 __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
134135
return std::__search_n_forward_impl<_ClassicAlgPolicy>(__first, __last, __count, __value, __pred, __proj);
135136
}
136137

libcxx/include/__functional/reference_wrapper.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <__memory/addressof.h>
1717
#include <__type_traits/enable_if.h>
1818
#include <__type_traits/remove_cvref.h>
19+
#include <__type_traits/void_t.h>
1920
#include <__utility/declval.h>
2021
#include <__utility/forward.h>
2122

@@ -38,9 +39,9 @@ class _LIBCPP_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp> {
3839
static void __fun(_Tp&&) = delete;
3940

4041
public:
41-
template <
42-
class _Up,
43-
class = __enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, decltype(__fun(std::declval<_Up>())) > >
42+
template <class _Up,
43+
class = __void_t<decltype(__fun(std::declval<_Up>()))>,
44+
__enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, int> = 0>
4445
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference_wrapper(_Up&& __u)
4546
_NOEXCEPT_(noexcept(__fun(std::declval<_Up>()))) {
4647
type& __f = static_cast<_Up&&>(__u);

libcxx/include/__hash_table

+1-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ public:
802802
return __emplace_unique_key_args(_NodeTypes::__get_key(__x), std::move(__x));
803803
}
804804

805-
template <class _Pp, class = __enable_if_t<!__is_same_uncvref<_Pp, __container_value_type>::value> >
805+
template <class _Pp, __enable_if_t<!__is_same_uncvref<_Pp, __container_value_type>::value, int> = 0>
806806
_LIBCPP_HIDE_FROM_ABI pair<iterator, bool> __insert_unique(_Pp&& __x) {
807807
return __emplace_unique(std::forward<_Pp>(__x));
808808
}

libcxx/include/__iterator/advance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ __advance(_RandIter& __i, typename iterator_traits<_RandIter>::difference_type _
6161
template < class _InputIter,
6262
class _Distance,
6363
class _IntegralDistance = decltype(std::__convert_to_integral(std::declval<_Distance>())),
64-
class = __enable_if_t<is_integral<_IntegralDistance>::value> >
64+
__enable_if_t<is_integral<_IntegralDistance>::value, int> = 0>
6565
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void advance(_InputIter& __i, _Distance __orig_n) {
6666
typedef typename iterator_traits<_InputIter>::difference_type _Difference;
6767
_Difference __n = static_cast<_Difference>(std::__convert_to_integral(__orig_n));

libcxx/include/__iterator/bounded_iter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct __bounded_iter {
5858
_LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter const&) = default;
5959
_LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter&&) = default;
6060

61-
template <class _OtherIterator, class = __enable_if_t< is_convertible<_OtherIterator, _Iterator>::value > >
61+
template <class _OtherIterator, __enable_if_t< is_convertible<_OtherIterator, _Iterator>::value, int> = 0>
6262
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter(__bounded_iter<_OtherIterator> const& __other) _NOEXCEPT
6363
: __current_(__other.__current_),
6464
__begin_(__other.__begin_),

libcxx/include/__iterator/move_iterator.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
157157
#else
158158
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator() : __current_() {}
159159

160-
template <class _Up,
161-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value > >
160+
template <class _Up, __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value, int> = 0>
162161
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator(const move_iterator<_Up>& __u)
163162
: __current_(__u.base()) {}
164163

165164
template <class _Up,
166-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value &&
167-
is_assignable<_Iter&, const _Up&>::value > >
165+
__enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value &&
166+
is_assignable<_Iter&, const _Up&>::value,
167+
int> = 0>
168168
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 move_iterator& operator=(const move_iterator<_Up>& __u) {
169169
__current_ = __u.base();
170170
return *this;

libcxx/include/__iterator/reverse_iterator.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
9696

9797
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit reverse_iterator(_Iter __x) : __t_(__x), current(__x) {}
9898

99-
template <class _Up,
100-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value > >
99+
template <class _Up, __enable_if_t<!is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value, int> = 0>
101100
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator(const reverse_iterator<_Up>& __u)
102101
: __t_(__u.base()), current(__u.base()) {}
103102

104103
template <class _Up,
105-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value &&
106-
is_assignable<_Iter&, _Up const&>::value > >
104+
__enable_if_t<!is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value &&
105+
is_assignable<_Iter&, _Up const&>::value,
106+
int> = 0>
107107
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
108108
__t_ = current = __u.base();
109109
return *this;
@@ -113,14 +113,14 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
113113

114114
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 explicit reverse_iterator(_Iter __x) : current(__x) {}
115115

116-
template <class _Up,
117-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value > >
116+
template <class _Up, __enable_if_t<!is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value, int> = 0>
118117
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator(const reverse_iterator<_Up>& __u)
119118
: current(__u.base()) {}
120119

121120
template <class _Up,
122-
class = __enable_if_t< !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value &&
123-
is_assignable<_Iter&, _Up const&>::value > >
121+
__enable_if_t<!is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value &&
122+
is_assignable<_Iter&, _Up const&>::value,
123+
int> = 0>
124124
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
125125
current = __u.base();
126126
return *this;

libcxx/include/__memory/allocator_traits.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,16 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
281281
return __a.allocate(__n);
282282
}
283283

284-
template <class _Ap = _Alloc, class = __enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
284+
template <class _Ap = _Alloc, __enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value, int> = 0>
285285
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
286286
allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) {
287287
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
288288
return __a.allocate(__n, __hint);
289289
_LIBCPP_SUPPRESS_DEPRECATED_POP
290290
}
291-
template <class _Ap = _Alloc,
292-
class = void,
293-
class = __enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
291+
template <class _Ap = _Alloc,
292+
class = void,
293+
__enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value, int> = 0>
294294
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
295295
allocate(allocator_type& __a, size_type __n, const_void_pointer) {
296296
return __a.allocate(__n);
@@ -313,7 +313,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
313313
__a.deallocate(__p, __n);
314314
}
315315

316-
template <class _Tp, class... _Args, class = __enable_if_t<__has_construct<allocator_type, _Tp*, _Args...>::value> >
316+
template <class _Tp, class... _Args, __enable_if_t<__has_construct<allocator_type, _Tp*, _Args...>::value, int> = 0>
317317
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void
318318
construct(allocator_type& __a, _Tp* __p, _Args&&... __args) {
319319
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -322,43 +322,43 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {
322322
}
323323
template <class _Tp,
324324
class... _Args,
325-
class = void,
326-
class = __enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
325+
class = void,
326+
__enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value, int> = 0>
327327
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void
328328
construct(allocator_type&, _Tp* __p, _Args&&... __args) {
329329
std::__construct_at(__p, std::forward<_Args>(__args)...);
330330
}
331331

332-
template <class _Tp, class = __enable_if_t<__has_destroy<allocator_type, _Tp*>::value> >
332+
template <class _Tp, __enable_if_t<__has_destroy<allocator_type, _Tp*>::value, int> = 0>
333333
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void destroy(allocator_type& __a, _Tp* __p) {
334334
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
335335
__a.destroy(__p);
336336
_LIBCPP_SUPPRESS_DEPRECATED_POP
337337
}
338-
template <class _Tp, class = void, class = __enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> >
338+
template <class _Tp, class = void, __enable_if_t<!__has_destroy<allocator_type, _Tp*>::value, int> = 0>
339339
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static void destroy(allocator_type&, _Tp* __p) {
340340
std::__destroy_at(__p);
341341
}
342342

343-
template <class _Ap = _Alloc, class = __enable_if_t<__has_max_size<const _Ap>::value> >
343+
template <class _Ap = _Alloc, __enable_if_t<__has_max_size<const _Ap>::value, int> = 0>
344344
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type& __a) _NOEXCEPT {
345345
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
346346
return __a.max_size();
347347
_LIBCPP_SUPPRESS_DEPRECATED_POP
348348
}
349-
template <class _Ap = _Alloc, class = void, class = __enable_if_t<!__has_max_size<const _Ap>::value> >
349+
template <class _Ap = _Alloc, class = void, __enable_if_t<!__has_max_size<const _Ap>::value, int> = 0>
350350
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static size_type max_size(const allocator_type&) _NOEXCEPT {
351351
return numeric_limits<size_type>::max() / sizeof(value_type);
352352
}
353353

354-
template <class _Ap = _Alloc, class = __enable_if_t<__has_select_on_container_copy_construction<const _Ap>::value> >
354+
template <class _Ap = _Alloc, __enable_if_t<__has_select_on_container_copy_construction<const _Ap>::value, int> = 0>
355355
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type
356356
select_on_container_copy_construction(const allocator_type& __a) {
357357
return __a.select_on_container_copy_construction();
358358
}
359-
template <class _Ap = _Alloc,
360-
class = void,
361-
class = __enable_if_t<!__has_select_on_container_copy_construction<const _Ap>::value> >
359+
template <class _Ap = _Alloc,
360+
class = void,
361+
__enable_if_t<!__has_select_on_container_copy_construction<const _Ap>::value, int> = 0>
362362
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static allocator_type
363363
select_on_container_copy_construction(const allocator_type& __a) {
364364
return __a;

libcxx/include/__memory/compressed_pair.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct __compressed_pair_elem {
4848
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
4949
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
5050

51-
template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
51+
template <class _Up, __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value, int> = 0>
5252
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(_Up&& __u)
5353
: __value_(std::forward<_Up>(__u)) {}
5454

@@ -77,7 +77,7 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
7777
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
7878
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
7979

80-
template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value> >
80+
template <class _Up, __enable_if_t<!is_same<__compressed_pair_elem, __decay_t<_Up> >::value, int> = 0>
8181
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(_Up&& __u)
8282
: __value_type(std::forward<_Up>(__u)) {}
8383

@@ -107,9 +107,10 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>, private __comp
107107
using _Base1 _LIBCPP_NODEBUG = __compressed_pair_elem<_T1, 0>;
108108
using _Base2 _LIBCPP_NODEBUG = __compressed_pair_elem<_T2, 1>;
109109

110-
template <bool _Dummy = true,
111-
class = __enable_if_t< __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
112-
__dependent_type<is_default_constructible<_T2>, _Dummy>::value > >
110+
template <bool _Dummy = true,
111+
__enable_if_t< __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
112+
__dependent_type<is_default_constructible<_T2>, _Dummy>::value,
113+
int> = 0>
113114
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair()
114115
: _Base1(__value_init_tag()), _Base2(__value_init_tag()) {}
115116

libcxx/include/__memory/pointer_traits.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct _IsFancyPointer {
201201
};
202202

203203
// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers
204-
template <class _Pointer, class = __enable_if_t< _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value > >
204+
template <class _Pointer, __enable_if_t< _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value, int> = 0>
205205
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
206206
__decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>
207207
__to_address(const _Pointer& __p) _NOEXCEPT {

0 commit comments

Comments
 (0)