[libcxx-commits] [libcxx] 475bd19 - [libc++][NFC] Refactor return type enable_ifs to defaulted template arguments

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 15 12:36:16 PDT 2023


Author: Nikolas Klauser
Date: 2023-08-15T12:19:21-07:00
New Revision: 475bd19ee8e42e68635b9770d5725461b7300914

URL: https://github.com/llvm/llvm-project/commit/475bd19ee8e42e68635b9770d5725461b7300914
DIFF: https://github.com/llvm/llvm-project/commit/475bd19ee8e42e68635b9770d5725461b7300914.diff

LOG: [libc++][NFC] Refactor return type enable_ifs to defaulted template arguments

This brings most of the enable_ifs in libc++ to the same style. It also has the nice side-effect of reducing the size of names of these symbols, since the depedent return type is shorter.

Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D157736

Added: 
    

Modified: 
    libcxx/include/__algorithm/copy_n.h
    libcxx/include/__algorithm/half_positive.h
    libcxx/include/__atomic/atomic.h
    libcxx/include/__atomic/cxx_atomic_impl.h
    libcxx/include/__chrono/duration.h
    libcxx/include/__chrono/time_point.h
    libcxx/include/__filesystem/path.h
    libcxx/include/__filesystem/u8path.h
    libcxx/include/__functional/bind.h
    libcxx/include/__iterator/next.h
    libcxx/include/__iterator/prev.h
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/__memory/unique_ptr.h
    libcxx/include/__random/discard_block_engine.h
    libcxx/include/__random/independent_bits_engine.h
    libcxx/include/__random/linear_congruential_engine.h
    libcxx/include/__random/mersenne_twister_engine.h
    libcxx/include/__random/shuffle_order_engine.h
    libcxx/include/__random/subtract_with_carry_engine.h
    libcxx/include/__system_error/error_code.h
    libcxx/include/__system_error/error_condition.h
    libcxx/include/__type_traits/is_swappable.h
    libcxx/include/__utility/convert_to_integral.h
    libcxx/include/__utility/pair.h
    libcxx/include/__utility/swap.h
    libcxx/include/cmath
    libcxx/include/complex
    libcxx/include/ostream
    libcxx/include/regex
    libcxx/include/set
    libcxx/include/valarray
    libcxx/include/vector

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/copy_n.h b/libcxx/include/__algorithm/copy_n.h
index f3701662aac384..c138d59e97956c 100644
--- a/libcxx/include/__algorithm/copy_n.h
+++ b/libcxx/include/__algorithm/copy_n.h
@@ -21,14 +21,11 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template<class _InputIterator, class _Size, class _OutputIterator>
+template<class _InputIterator, class _Size, class _OutputIterator,
+         __enable_if_t<__has_input_iterator_category<_InputIterator>::value &&
+                       !__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    __has_input_iterator_category<_InputIterator>::value &&
-   !__has_random_access_iterator_category<_InputIterator>::value,
-    _OutputIterator
->::type
+_OutputIterator
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
     typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
@@ -47,13 +44,10 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
     return __result;
 }
 
-template<class _InputIterator, class _Size, class _OutputIterator>
+template<class _InputIterator, class _Size, class _OutputIterator,
+         __enable_if_t<__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    __has_random_access_iterator_category<_InputIterator>::value,
-    _OutputIterator
->::type
+_OutputIterator
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
     typedef typename iterator_traits<_InputIterator>::
diff erence_type 
diff erence_type;

diff  --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h
index 5a0f4baf6aaaf8..e90666d1342f3d 100644
--- a/libcxx/include/__algorithm/half_positive.h
+++ b/libcxx/include/__algorithm/half_positive.h
@@ -22,25 +22,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // Perform division by two quickly for positive integers (llvm.org/PR39129)
 
-template <typename _Integral>
+template <typename _Integral, __enable_if_t<is_integral<_Integral>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    is_integral<_Integral>::value,
-    _Integral
->::type
+_Integral
 __half_positive(_Integral __value)
 {
     return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2);
 }
 
-template <typename _Tp>
+template <typename _Tp, __enable_if_t<!is_integral<_Tp>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    !is_integral<_Tp>::value,
-    _Tp
->::type
+_Tp
 __half_positive(_Tp __value)
 {
     return __value / 2;

diff  --git a/libcxx/include/__atomic/atomic.h b/libcxx/include/__atomic/atomic.h
index 68df7f12c1e585..47de6b958a96c1 100644
--- a/libcxx/include/__atomic/atomic.h
+++ b/libcxx/include/__atomic/atomic.h
@@ -505,25 +505,17 @@ _Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence
 
 // atomic_fetch_and
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_and(__op);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_and(__op);
@@ -531,25 +523,17 @@ atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
 
 // atomic_fetch_and_explicit
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_and(__op, __m);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_and(__op, __m);
@@ -557,25 +541,17 @@ atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
 
 // atomic_fetch_or
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_or(__op);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_or(__op);
@@ -583,25 +559,17 @@ atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCE
 
 // atomic_fetch_or_explicit
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_or(__op, __m);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_or(__op, __m);
@@ -609,25 +577,17 @@ atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op
 
 // atomic_fetch_xor
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_xor(__op);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
 {
     return __o->fetch_xor(__op);
@@ -635,25 +595,17 @@ atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
 
 // atomic_fetch_xor_explicit
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_xor(__op, __m);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if
-<
-    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
-    _Tp
->::type
+_Tp
 atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_xor(__op, __m);

diff  --git a/libcxx/include/__atomic/cxx_atomic_impl.h b/libcxx/include/__atomic/cxx_atomic_impl.h
index 167cee7f0bdece..d670fddc3934cd 100644
--- a/libcxx/include/__atomic/cxx_atomic_impl.h
+++ b/libcxx/include/__atomic/cxx_atomic_impl.h
@@ -32,14 +32,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
 // the default operator= in an object is not volatile, a byte-by-byte copy
 // is required.
-template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
+template <typename _Tp, typename _Tv, __enable_if_t<is_assignable<_Tp&, _Tv>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
   __a_value = __val;
 }
-template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
-typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
-__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
+template <typename _Tp, typename _Tv, __enable_if_t<is_assignable<_Tp&, _Tv>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI
+void __cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
   volatile char* __to         = reinterpret_cast<volatile char*>(std::addressof(__a_value));
   volatile char* __end = __to + sizeof(_Tp);
   volatile const char* __from = reinterpret_cast<volatile const char*>(std::addressof(__val));

diff  --git a/libcxx/include/__chrono/duration.h b/libcxx/include/__chrono/duration.h
index 96e9671eb5a9ea..4c84278426887b 100644
--- a/libcxx/include/__chrono/duration.h
+++ b/libcxx/include/__chrono/duration.h
@@ -116,14 +116,10 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
     }
 };
 
-template <class _ToDuration, class _Rep, class _Period>
+template <class _ToDuration, class _Rep, class _Period, __enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    _ToDuration
->::type
+_ToDuration
 duration_cast(const duration<_Rep, _Period>& __fd)
 {
     return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
@@ -147,13 +143,9 @@ struct _LIBCPP_TEMPLATE_VIS duration_values
 };
 
 #if _LIBCPP_STD_VER >= 17
-template <class _ToDuration, class _Rep, class _Period>
+template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    _ToDuration
->::type
+_ToDuration
 floor(const duration<_Rep, _Period>& __d)
 {
     _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
@@ -162,13 +154,9 @@ floor(const duration<_Rep, _Period>& __d)
     return __t;
 }
 
-template <class _ToDuration, class _Rep, class _Period>
+template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    _ToDuration
->::type
+_ToDuration
 ceil(const duration<_Rep, _Period>& __d)
 {
     _ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
@@ -177,13 +165,9 @@ ceil(const duration<_Rep, _Period>& __d)
     return __t;
 }
 
-template <class _ToDuration, class _Rep, class _Period>
+template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    _ToDuration
->::type
+_ToDuration
 round(const duration<_Rep, _Period>& __d)
 {
     _ToDuration __lower = chrono::floor<_ToDuration>(__d);
@@ -462,14 +446,11 @@ operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 
 // Duration *
 
-template <class _Rep1, class _Period, class _Rep2>
+template <class _Rep1, class _Period, class _Rep2,
+          __enable_if_t<is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
-    duration<typename common_type<_Rep1, _Rep2>::type, _Period>
->::type
+duration<typename common_type<_Rep1, _Rep2>::type, _Period>
 operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 {
     typedef typename common_type<_Rep1, _Rep2>::type _Cr;
@@ -477,14 +458,11 @@ operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
     return _Cd(_Cd(__d).count() * static_cast<_Cr>(__s));
 }
 
-template <class _Rep1, class _Period, class _Rep2>
+template <class _Rep1, class _Period, class _Rep2,
+          __enable_if_t<is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value,
-    duration<typename common_type<_Rep1, _Rep2>::type, _Period>
->::type
+duration<typename common_type<_Rep1, _Rep2>::type, _Period>
 operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
 {
     return __d * __s;
@@ -492,15 +470,11 @@ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
 
 // Duration /
 
-template <class _Rep1, class _Period, class _Rep2>
+template <class _Rep1, class _Period, class _Rep2,
+          __enable_if_t<!__is_duration<_Rep2>::value && is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    !__is_duration<_Rep2>::value &&
-      is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
-    duration<typename common_type<_Rep1, _Rep2>::type, _Period>
->::type
+duration<typename common_type<_Rep1, _Rep2>::type, _Period>
 operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 {
     typedef typename common_type<_Rep1, _Rep2>::type _Cr;
@@ -520,15 +494,11 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 
 // Duration %
 
-template <class _Rep1, class _Period, class _Rep2>
+template <class _Rep1, class _Period, class _Rep2,
+          __enable_if_t<!__is_duration<_Rep2>::value && is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
 _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    !__is_duration<_Rep2>::value &&
-      is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
-    duration<typename common_type<_Rep1, _Rep2>::type, _Period>
->::type
+duration<typename common_type<_Rep1, _Rep2>::type, _Period>
 operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 {
     typedef typename common_type<_Rep1, _Rep2>::type _Cr;

diff  --git a/libcxx/include/__chrono/time_point.h b/libcxx/include/__chrono/time_point.h
index c14835401fa409..d804d9d62bba6a 100644
--- a/libcxx/include/__chrono/time_point.h
+++ b/libcxx/include/__chrono/time_point.h
@@ -93,49 +93,33 @@ time_point_cast(const time_point<_Clock, _Duration>& __t)
 }
 
 #if _LIBCPP_STD_VER >= 17
-template <class _ToDuration, class _Clock, class _Duration>
+template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    time_point<_Clock, _ToDuration>
->::type
+time_point<_Clock, _ToDuration>
 floor(const time_point<_Clock, _Duration>& __t)
 {
     return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};
 }
 
-template <class _ToDuration, class _Clock, class _Duration>
+template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    time_point<_Clock, _ToDuration>
->::type
+time_point<_Clock, _ToDuration>
 ceil(const time_point<_Clock, _Duration>& __t)
 {
     return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};
 }
 
-template <class _ToDuration, class _Clock, class _Duration>
+template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    __is_duration<_ToDuration>::value,
-    time_point<_Clock, _ToDuration>
->::type
+time_point<_Clock, _ToDuration>
 round(const time_point<_Clock, _Duration>& __t)
 {
     return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};
 }
 
-template <class _Rep, class _Period>
+template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if
-<
-    numeric_limits<_Rep>::is_signed,
-    duration<_Rep, _Period>
->::type
+duration<_Rep, _Period>
 abs(duration<_Rep, _Period> __d)
 {
     return __d >= __d.zero() ? +__d : -__d;

diff  --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 77699c5ae47fd8..aacce27a71c511 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -76,9 +76,9 @@ struct __can_convert_char<char32_t> {
   using __char_type = char32_t;
 };
 
-template <class _ECharT>
+template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI
-typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
+bool
 __is_separator(_ECharT __e) {
 #if defined(_LIBCPP_WIN32API)
   return __e == _ECharT('/') || __e == _ECharT('\\');
@@ -305,17 +305,17 @@ struct _PathCVT {
 template <>
 struct _PathCVT<__path_value> {
 
-  template <class _Iter>
+  template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI
-  static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
+  static void
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     for (; __b != __e; ++__b)
       __dest.push_back(*__b);
   }
 
-  template <class _Iter>
+  template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI
-  static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
+  static void
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     __dest.append(__b, __e);
   }
@@ -350,17 +350,17 @@ struct _PathCVT<char> {
       __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);
   }
 
-  template <class _Iter>
+  template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI
-  static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
+  static void
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     basic_string<char> __tmp(__b, __e);
     __append_string(__dest, __tmp);
   }
 
-  template <class _Iter>
+  template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI
-  static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
+  static void
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     basic_string<char> __tmp(__b, __e);
     __append_string(__dest, __tmp);
@@ -678,9 +678,9 @@ class _LIBCPP_EXPORTED_FROM_ABI path {
     return *this;
   }
 
-  template <class _ECharT>
+  template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI
-  typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
+  path&
   operator+=(_ECharT __x) {
     _PathCVT<_ECharT>::__append_source(__pn_,
                                        basic_string_view<_ECharT>(&__x, 1));
@@ -1040,21 +1040,19 @@ class _LIBCPP_EXPORTED_FROM_ABI path {
   iterator end() const;
 
 #if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-  template <class _CharT, class _Traits>
+  template <class _CharT, class _Traits, __enable_if_t<is_same<_CharT, value_type>::value &&
+                                                       is_same<_Traits, char_traits<value_type> >::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI friend
-      typename enable_if<is_same<_CharT, value_type>::value &&
-                             is_same<_Traits, char_traits<value_type> >::value,
-                         basic_ostream<_CharT, _Traits>&>::type
+  basic_ostream<_CharT, _Traits>&
       operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
     __os << _VSTD::__quoted(__p.native());
     return __os;
   }
 
-  template <class _CharT, class _Traits>
+  template <class _CharT, class _Traits, __enable_if_t<!is_same<_CharT, value_type>::value ||
+                                                       !is_same<_Traits, char_traits<value_type> >::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI friend
-      typename enable_if<!is_same<_CharT, value_type>::value ||
-                             !is_same<_Traits, char_traits<value_type> >::value,
-                         basic_ostream<_CharT, _Traits>&>::type
+  basic_ostream<_CharT, _Traits>&
       operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
     __os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
     return __os;

diff  --git a/libcxx/include/__filesystem/u8path.h b/libcxx/include/__filesystem/u8path.h
index 90b879aec28ef8..1db60c3960a8a9 100644
--- a/libcxx/include/__filesystem/u8path.h
+++ b/libcxx/include/__filesystem/u8path.h
@@ -32,9 +32,9 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
-template <class _InputIt>
+template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
-    typename enable_if<__is_pathable<_InputIt>::value, path>::type
+    path
     u8path(_InputIt __f, _InputIt __l) {
   static_assert(
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
@@ -56,9 +56,9 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
 }
 
 #if defined(_LIBCPP_WIN32API)
-template <class _InputIt>
+template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
-    typename enable_if<__is_pathable<_InputIt>::value, path>::type
+    path
     u8path(_InputIt __f, _NullSentinel) {
   static_assert(
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
@@ -79,9 +79,9 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
 }
 #endif /* _LIBCPP_WIN32API */
 
-template <class _Source>
+template <class _Source, __enable_if_t<__is_pathable<_Source>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
-    typename enable_if<__is_pathable<_Source>::value, path>::type
+    path
     u8path(const _Source& __s) {
   static_assert(
 #ifndef _LIBCPP_HAS_NO_CHAR8_T

diff  --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index 398cb3dc3480fa..a37c6a1cb6faff 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -120,28 +120,20 @@ struct __mu_return2<true, _Ti, _Uj>
     typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
 };
 
-template <class _Ti, class _Uj>
+template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    0 < is_placeholder<_Ti>::value,
-    typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
->::type
+typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
 __mu(_Ti&, _Uj& __uj)
 {
     const size_t __indx = is_placeholder<_Ti>::value - 1;
     return _VSTD::forward<typename tuple_element<__indx, _Uj>::type>(_VSTD::get<__indx>(__uj));
 }
 
-template <class _Ti, class _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>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    !is_bind_expression<_Ti>::value &&
-    is_placeholder<_Ti>::value == 0 &&
-    !__is_reference_wrapper<_Ti>::value,
-    _Ti&
->::type
+_Ti&
 __mu(_Ti& __ti, _Uj&)
 {
     return __ti;
@@ -329,28 +321,20 @@ class __bind_r
         : base(_VSTD::forward<_Gp>(__f),
                _VSTD::forward<_BA>(__bound_args)...) {}
 
-    template <class ..._Args>
+    template <class ..._Args, __enable_if_t<is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
+                                                           result_type>::value || is_void<_Rp>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-        typename enable_if
-        <
-            is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
-                           result_type>::value || is_void<_Rp>::value,
-            result_type
-        >::type
+        result_type
         operator()(_Args&& ...__args)
         {
             typedef __invoke_void_return_wrapper<_Rp> _Invoker;
             return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
         }
 
-    template <class ..._Args>
+    template <class ..._Args, __enable_if_t<is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
+                                                           result_type>::value || is_void<_Rp>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-        typename enable_if
-        <
-            is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
-                           result_type>::value || is_void<_Rp>::value,
-            result_type
-        >::type
+        result_type
         operator()(_Args&& ...__args) const
         {
             typedef __invoke_void_return_wrapper<_Rp> _Invoker;

diff  --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h
index 5aba095dc485b6..5f21e7b4e10346 100644
--- a/libcxx/include/__iterator/next.h
+++ b/libcxx/include/__iterator/next.h
@@ -24,9 +24,9 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _InputIter>
+template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
-    typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
+    _InputIter
     next(_InputIter __x, typename iterator_traits<_InputIter>::
diff erence_type __n = 1) {
   _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
                                "Attempt to next(it, n) with negative n on a non-bidirectional iterator");

diff  --git a/libcxx/include/__iterator/prev.h b/libcxx/include/__iterator/prev.h
index d31cd8e49bbfd0..08a22fe8ca3f1c 100644
--- a/libcxx/include/__iterator/prev.h
+++ b/libcxx/include/__iterator/prev.h
@@ -24,9 +24,9 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _InputIter>
+template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
-    typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
+    _InputIter
     prev(_InputIter __x, typename iterator_traits<_InputIter>::
diff erence_type __n = 1) {
   _LIBCPP_ASSERT_UNCATEGORIZED(__n <= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
                                "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");

diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index dce44a7b373215..e032e3752ebb14 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -1642,33 +1642,18 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
 
     _LIBCPP_INLINE_VISIBILITY
     weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
-    template<class _Yp>
-        typename enable_if
-        <
-            __compatible_with<_Yp, _Tp>::value,
-            weak_ptr&
-        >::type
-        _LIBCPP_INLINE_VISIBILITY
+    template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY weak_ptr&
         operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
 
     _LIBCPP_INLINE_VISIBILITY
     weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
-    template<class _Yp>
-        typename enable_if
-        <
-            __compatible_with<_Yp, _Tp>::value,
-            weak_ptr&
-        >::type
-        _LIBCPP_INLINE_VISIBILITY
+    template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY weak_ptr&
         operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
 
-    template<class _Yp>
-        typename enable_if
-        <
-            __compatible_with<_Yp, _Tp>::value,
-            weak_ptr&
-        >::type
-        _LIBCPP_INLINE_VISIBILITY
+    template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY weak_ptr&
         operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1786,13 +1771,9 @@ weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
 }
 
 template<class _Tp>
-template<class _Yp>
+template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
 inline
-typename enable_if
-<
-    __compatible_with<_Yp, _Tp>::value,
-    weak_ptr<_Tp>&
->::type
+weak_ptr<_Tp>&
 weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
 {
     weak_ptr(__r).swap(*this);
@@ -1809,13 +1790,9 @@ weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
 }
 
 template<class _Tp>
-template<class _Yp>
+template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
 inline
-typename enable_if
-<
-    __compatible_with<_Yp, _Tp>::value,
-    weak_ptr<_Tp>&
->::type
+weak_ptr<_Tp>&
 weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
 {
     weak_ptr(_VSTD::move(__r)).swap(*this);
@@ -1823,13 +1800,9 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
 }
 
 template<class _Tp>
-template<class _Yp>
+template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
 inline
-typename enable_if
-<
-    __compatible_with<_Yp, _Tp>::value,
-    weak_ptr<_Tp>&
->::type
+weak_ptr<_Tp>&
 weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
 {
     weak_ptr(__r).swap(*this);

diff  --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 5a968789719698..295e0575ad46ad 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -247,11 +247,10 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
   }
 
 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-  template <class _Up>
+  template <class _Up, __enable_if_t<is_convertible<_Up*, _Tp*>::value &&
+                                     is_same<_Dp, default_delete<_Tp> >::value, int> = 0>
   _LIBCPP_INLINE_VISIBILITY
-      typename enable_if<is_convertible<_Up*, _Tp*>::value &&
-                             is_same<_Dp, default_delete<_Tp> >::value,
-                         unique_ptr&>::type
+  unique_ptr&
       operator=(auto_ptr<_Up> __p) {
     reset(__p.release());
     return *this;
@@ -490,10 +489,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
     return __t;
   }
 
-  template <class _Pp>
+  template <class _Pp, __enable_if_t<_CheckArrayPointerConversion<_Pp>::value, int> = 0>
   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
-      typename enable_if< _CheckArrayPointerConversion<_Pp>::value >::type
-      reset(_Pp __p) _NOEXCEPT {
+  void reset(_Pp __p) _NOEXCEPT {
     pointer __tmp = __ptr_.first();
     __ptr_.first() = __p;
     if (__tmp)
@@ -512,9 +510,9 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
   }
 };
 
-template <class _Tp, class _Dp>
+template <class _Tp, class _Dp, __enable_if_t<__is_swappable<_Dp>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
-    typename enable_if< __is_swappable<_Dp>::value, void >::type
+    void
     swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {
   __x.swap(__y);
 }

diff  --git a/libcxx/include/__random/discard_block_engine.h b/libcxx/include/__random/discard_block_engine.h
index 7bdcb6555cd51f..5995bd3d352fb3 100644
--- a/libcxx/include/__random/discard_block_engine.h
+++ b/libcxx/include/__random/discard_block_engine.h
@@ -82,13 +82,9 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine
     void seed() {__e_.seed(); __n_ = 0;}
     _LIBCPP_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd); __n_ = 0;}
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, discard_block_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
 
     // generating functions

diff  --git a/libcxx/include/__random/independent_bits_engine.h b/libcxx/include/__random/independent_bits_engine.h
index a86c22157d0b32..ce527d9de42b82 100644
--- a/libcxx/include/__random/independent_bits_engine.h
+++ b/libcxx/include/__random/independent_bits_engine.h
@@ -114,13 +114,9 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
     void seed() {__e_.seed();}
     _LIBCPP_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd);}
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, independent_bits_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q) {__e_.seed(__q);}
 
     // generating functions
@@ -166,24 +162,16 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
     result_type __eval(false_type);
     _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type);
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<__count < _Dt, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            __count < _Dt,
-            result_type
-        >::type
+        result_type
         __lshift(result_type __x) {return __x << __count;}
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<(__count >= _Dt), int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            (__count >= _Dt),
-            result_type
-        >::type
+        result_type
         __lshift(result_type) {return result_type(0);}
 };
 

diff  --git a/libcxx/include/__random/linear_congruential_engine.h b/libcxx/include/__random/linear_congruential_engine.h
index 2c2276eccf05e2..1cf138c00e2a6e 100644
--- a/libcxx/include/__random/linear_congruential_engine.h
+++ b/libcxx/include/__random/linear_congruential_engine.h
@@ -255,13 +255,9 @@ class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
     void seed(result_type __s = default_seed)
         {seed(integral_constant<bool, __m == 0>(),
               integral_constant<bool, __c == 0>(), __s);}
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, linear_congruential_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q)
             {__seed(__q, integral_constant<unsigned,
                 1 + (__m == 0 ? (sizeof(result_type) * __CHAR_BIT__ - 1)/32

diff  --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h
index 663a6c704b77d3..081b9617828454 100644
--- a/libcxx/include/__random/mersenne_twister_engine.h
+++ b/libcxx/include/__random/mersenne_twister_engine.h
@@ -141,13 +141,9 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
         typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
         {seed(__q);}
     _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q)
             {__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
 
@@ -202,44 +198,28 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
     template<class _Sseq>
     _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<__count < __w, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            __count < __w,
-            result_type
-        >::type
+        result_type
         __lshift(result_type __x) {return (__x << __count) & _Max;}
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<(__count >= __w), int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            (__count >= __w),
-            result_type
-        >::type
+        result_type
         __lshift(result_type) {return result_type(0);}
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<__count < _Dt, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            __count < _Dt,
-            result_type
-        >::type
+        result_type
         __rshift(result_type __x) {return __x >> __count;}
 
-    template <size_t __count>
+    template <size_t __count, __enable_if_t<(__count >= _Dt), int> = 0>
         _LIBCPP_INLINE_VISIBILITY
         static
-        typename enable_if
-        <
-            (__count >= _Dt),
-            result_type
-        >::type
+        result_type
         __rshift(result_type) {return result_type(0);}
 };
 

diff  --git a/libcxx/include/__random/shuffle_order_engine.h b/libcxx/include/__random/shuffle_order_engine.h
index e07f230d21c779..ad3422519b9f6b 100644
--- a/libcxx/include/__random/shuffle_order_engine.h
+++ b/libcxx/include/__random/shuffle_order_engine.h
@@ -108,13 +108,9 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
     void seed() {__e_.seed(); __init();}
     _LIBCPP_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd); __init();}
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, shuffle_order_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q) {__e_.seed(__q); __init();}
 
     // generating functions
@@ -174,23 +170,15 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
     _LIBCPP_INLINE_VISIBILITY
     result_type __eval2(true_type) {return __evalf<__k, 0>();}
 
-    template <uint64_t _Np, uint64_t _Dp>
+    template <uint64_t _Np, uint64_t _Dp, __enable_if_t<(__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            (__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)),
-            result_type
-        >::type
+        result_type
         __eval(__uratio<_Np, _Dp>)
             {return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();}
 
-    template <uint64_t _Np, uint64_t _Dp>
+    template <uint64_t _Np, uint64_t _Dp, __enable_if_t<__uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min),
-            result_type
-        >::type
+        result_type
         __eval(__uratio<_Np, _Dp>)
         {
             const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (__y_ - _Min)

diff  --git a/libcxx/include/__random/subtract_with_carry_engine.h b/libcxx/include/__random/subtract_with_carry_engine.h
index c8954ca1119555..afff83e2007bae 100644
--- a/libcxx/include/__random/subtract_with_carry_engine.h
+++ b/libcxx/include/__random/subtract_with_carry_engine.h
@@ -109,13 +109,9 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
     _LIBCPP_INLINE_VISIBILITY
     void seed(result_type __sd = default_seed)
         {seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
-    template<class _Sseq>
+    template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
-            void
-        >::type
+        void
         seed(_Sseq& __q)
             {__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
 

diff  --git a/libcxx/include/__system_error/error_code.h b/libcxx/include/__system_error/error_code.h
index d05e68529faf8d..6188888aa778d7 100644
--- a/libcxx/include/__system_error/error_code.h
+++ b/libcxx/include/__system_error/error_code.h
@@ -61,9 +61,8 @@ class _LIBCPP_EXPORTED_FROM_ABI error_code {
     __cat_ = &__cat;
   }
 
-  template <class _Ep>
-  _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
-  operator=(_Ep __e) _NOEXCEPT {
+  template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
+  _LIBCPP_HIDE_FROM_ABI error_code& operator=(_Ep __e) _NOEXCEPT {
     using __adl_only::make_error_code;
     *this = make_error_code(__e);
     return *this;

diff  --git a/libcxx/include/__system_error/error_condition.h b/libcxx/include/__system_error/error_condition.h
index a43a73cdc26032..278598378bf589 100644
--- a/libcxx/include/__system_error/error_condition.h
+++ b/libcxx/include/__system_error/error_condition.h
@@ -70,9 +70,8 @@ class _LIBCPP_EXPORTED_FROM_ABI error_condition {
     __cat_ = &__cat;
   }
 
-  template <class _Ep>
-  _LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
-  operator=(_Ep __e) _NOEXCEPT {
+  template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
+  _LIBCPP_HIDE_FROM_ABI error_condition& operator=(_Ep __e) _NOEXCEPT {
     using __adl_only::make_error_condition;
     *this = make_error_condition(__e);
     return *this;

diff  --git a/libcxx/include/__type_traits/is_swappable.h b/libcxx/include/__type_traits/is_swappable.h
index 07c56619856d36..efcc9b004973bf 100644
--- a/libcxx/include/__type_traits/is_swappable.h
+++ b/libcxx/include/__type_traits/is_swappable.h
@@ -47,10 +47,9 @@ template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y)
     _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value);
 
-template <class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
-    typename enable_if<__is_swappable<_Tp>::value>::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
-        _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
+template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> = 0>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
+    _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
 
 namespace __detail {
 // ALL generic swap overloads MUST already have a declaration available at this point.

diff  --git a/libcxx/include/__utility/convert_to_integral.h b/libcxx/include/__utility/convert_to_integral.h
index 0cc858ad159079..adead18e05ee5d 100644
--- a/libcxx/include/__utility/convert_to_integral.h
+++ b/libcxx/include/__utility/convert_to_integral.h
@@ -39,9 +39,9 @@ long long __convert_to_integral(long long __val) { return __val; }
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
 unsigned long long __convert_to_integral(unsigned long long __val) {return __val; }
 
-template<typename _Fp>
+template<typename _Fp, __enable_if_t<is_floating_point<_Fp>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-typename enable_if<is_floating_point<_Fp>::value, long long>::type
+long long
  __convert_to_integral(_Fp __val) { return __val; }
 
 #ifndef _LIBCPP_HAS_NO_INT128

diff  --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index 43c9dbec737b01..79b0ca473b43ef 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -688,14 +688,9 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
 };
 #endif // _LIBCPP_STD_VER >= 23
 
-template <class _T1, class _T2>
+template <class _T1, class _T2, __enable_if_t<__is_swappable<_T1>::value && __is_swappable<_T2>::value, int> = 0>
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    __is_swappable<_T1>::value &&
-    __is_swappable<_T2>::value,
-    void
->::type
+void
 swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
                      _NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
                                  __is_nothrow_swappable<_T2>::value))

diff  --git a/libcxx/include/__utility/swap.h b/libcxx/include/__utility/swap.h
index 767f69cc2fffca..a4e1ba08284d21 100644
--- a/libcxx/include/__utility/swap.h
+++ b/libcxx/include/__utility/swap.h
@@ -44,9 +44,9 @@ inline _LIBCPP_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CX
   __y = _VSTD::move(__t);
 }
 
-template <class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if<__is_swappable<_Tp>::value>::type
-swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
+template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> >
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
+    _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
   for (size_t __i = 0; __i != _Np; ++__i) {
     swap(__a[__i], __b[__i]);
   }

diff  --git a/libcxx/include/cmath b/libcxx/include/cmath
index 99c6caf2b7d56d..86da2df0c0f70c 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -569,9 +569,9 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
 }
 #endif
 
-template <class _A1>
+template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isnan)
@@ -581,17 +581,17 @@ __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
 #endif
 }
 
-template <class _A1>
+template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
 {
     return std::isnan(__lcpp_x);
 }
 
-template <class _A1>
+template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isinf)
@@ -601,17 +601,17 @@ __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
 #endif
 }
 
-template <class _A1>
+template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
 {
     return std::isinf(__lcpp_x);
 }
 
-template <class _A1>
+template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isfinite)
@@ -621,9 +621,9 @@ __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
 #endif
 }
 
-template <class _A1>
+template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
 _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+_LIBCPP_CONSTEXPR bool
 __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
 {
     return __builtin_isfinite(__lcpp_x);

diff  --git a/libcxx/include/complex b/libcxx/include/complex
index d12cfa938dc3e7..c8ffde9515636c 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -942,35 +942,25 @@ arg(const complex<_Tp>& __c)
     return std::atan2(__c.imag(), __c.real());
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_same<_Tp, long double>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
-    is_same<_Tp, long double>::value,
-    long double
->::type
+long double
 arg(_Tp __re)
 {
     return std::atan2l(0.L, __re);
 }
 
-template<class _Tp>
+template<class _Tp, __enable_if_t<is_integral<_Tp>::value || is_same<_Tp, double>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_integral<_Tp>::value || is_same<_Tp, double>::value,
-    double
->::type
+double
 arg(_Tp __re)
 {
     return std::atan2(0., __re);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_same<_Tp, float>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<
-    is_same<_Tp, float>::value,
-    float
->::type
+float
 arg(_Tp __re)
 {
     return std::atan2f(0.F, __re);
@@ -1033,13 +1023,9 @@ proj(const complex<_Tp>& __c)
     return __r;
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_floating_point<_Tp>::value,
-    typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
 proj(_Tp __re)
 {
     if (std::__constexpr_isinf(__re))
@@ -1047,13 +1033,9 @@ proj(_Tp __re)
     return complex<_Tp>(__re);
 }
 
-template <class _Tp>
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_integral<_Tp>::value,
-    typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
 proj(_Tp __re)
 {
     typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
@@ -1173,26 +1155,18 @@ pow(const complex<_Tp>& __x, const complex<_Up>& __y)
     return _VSTD::pow(result_type(__x), result_type(__y));
 }
 
-template<class _Tp, class _Up>
+template<class _Tp, class _Up, __enable_if_t<is_arithmetic<_Up>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_arithmetic<_Up>::value,
-    complex<typename __promote<_Tp, _Up>::type>
->::type
+complex<typename __promote<_Tp, _Up>::type>
 pow(const complex<_Tp>& __x, const _Up& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
     return _VSTD::pow(result_type(__x), result_type(__y));
 }
 
-template<class _Tp, class _Up>
+template<class _Tp, class _Up, __enable_if_t<is_arithmetic<_Tp>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_arithmetic<_Tp>::value,
-    complex<typename __promote<_Tp, _Up>::type>
->::type
+complex<typename __promote<_Tp, _Up>::type>
 pow(const _Tp& __x, const complex<_Up>& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;

diff  --git a/libcxx/include/ostream b/libcxx/include/ostream
index 168a75376bd948..4c59b264db741f 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -1117,15 +1117,17 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
     return __os << __p.get();
 }
 
-template<class _CharT, class _Traits, class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    is_same<void, __void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>() << std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value,
-    basic_ostream<_CharT, _Traits>&
->::type
-operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p)
-{
+template <
+    class _CharT,
+    class _Traits,
+    class _Yp,
+    class _Dp,
+    __enable_if_t<is_same<void,
+                          __void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>()
+                                             << std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value,
+                  int> = 0>
+inline _LIBCPP_INLINE_VISIBILITY basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) {
     return __os << __p.get();
 }
 

diff  --git a/libcxx/include/regex b/libcxx/include/regex
index be1bce10ebd19e..e62b9eec636f5e 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -2776,9 +2776,9 @@ public:
                             flag_type __f = regex_constants::ECMAScript)
             {return assign(__s.begin(), __s.end(), __f);}
 
-    template <class _InputIterator>
+    template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value, basic_regex&>::type
+        basic_regex&
         assign(_InputIterator __first, _InputIterator __last,
                             flag_type __f = regex_constants::ECMAScript)
         {
@@ -2798,13 +2798,9 @@ private:
     }
 public:
 
-    template <class _ForwardIterator>
+    template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-            __has_forward_iterator_category<_ForwardIterator>::value,
-            basic_regex&
-        >::type
+        basic_regex&
         assign(_ForwardIterator __first, _ForwardIterator __last,
                             flag_type __f = regex_constants::ECMAScript)
         {

diff  --git a/libcxx/include/set b/libcxx/include/set
index e44f33e3d47b39..75be1e13ede511 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -920,13 +920,13 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     find(const _K2& __k)                           {return __tree_.find(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
@@ -934,18 +934,18 @@ public:
     size_type      count(const key_type& __k) const
         {return __tree_.__count_unique(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
+    size_type
     count(const _K2& __k) const                    {return __tree_.__count_multi(__k);}
 #endif
 
 #if _LIBCPP_STD_VER >= 20
     _LIBCPP_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+    bool
     contains(const _K2& __k) const { return find(__k) != end(); }
 #endif // _LIBCPP_STD_VER >= 20
 
@@ -956,14 +956,14 @@ public:
     const_iterator lower_bound(const key_type& __k) const
         {return __tree_.lower_bound(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
@@ -974,13 +974,13 @@ public:
     const_iterator upper_bound(const key_type& __k) const
         {return __tree_.upper_bound(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
@@ -991,13 +991,13 @@ public:
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
         {return __tree_.__equal_range_unique(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+    pair<iterator,iterator>
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+    pair<const_iterator,const_iterator>
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
 };
@@ -1511,13 +1511,13 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     find(const _K2& __k)                           {return __tree_.find(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
@@ -1525,18 +1525,18 @@ public:
     size_type      count(const key_type& __k) const
         {return __tree_.__count_multi(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
+    size_type
     count(const _K2& __k) const            {return __tree_.__count_multi(__k);}
 #endif
 
 #if _LIBCPP_STD_VER >= 20
     _LIBCPP_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
+     bool
     contains(const _K2& __k) const { return find(__k) != end(); }
 #endif // _LIBCPP_STD_VER >= 20
 
@@ -1547,14 +1547,14 @@ public:
     const_iterator lower_bound(const key_type& __k) const
             {return __tree_.lower_bound(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
@@ -1565,13 +1565,13 @@ public:
     const_iterator upper_bound(const key_type& __k) const
             {return __tree_.upper_bound(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
+    iterator
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
+    const_iterator
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
@@ -1582,13 +1582,13 @@ public:
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
             {return __tree_.__equal_range_multi(__k);}
 #if _LIBCPP_STD_VER >= 14
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
+    pair<iterator,iterator>
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
-    template <typename _K2>
+    template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
     _LIBCPP_INLINE_VISIBILITY
-    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
+    pair<const_iterator,const_iterator>
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
 };

diff  --git a/libcxx/include/valarray b/libcxx/include/valarray
index 09a7c9016c994d..7db1bba0182ae5 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -971,94 +971,44 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     valarray& operator>>=(const value_type& __x);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator*= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator/= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator%= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator+= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator-= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator^= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator|= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator&= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator<<= (const _Expr& __v);
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        valarray&
-    >::type
-    _LIBCPP_INLINE_VISIBILITY
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    _LIBCPP_INLINE_VISIBILITY valarray&
     operator>>= (const _Expr& __v);
 
     // member functions:
@@ -1219,102 +1169,58 @@ private:
     size_t __stride_;
 
 public:
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator*=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator/=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator%=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator+=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator-=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator^=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator&=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator|=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator<<=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator>>=(const _Expr& __v) const;
 
@@ -1353,13 +1259,9 @@ slice_array<_Tp>::operator=(const slice_array& __sa) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1377,13 +1279,9 @@ slice_array<_Tp>::operator=(const valarray<value_type>& __va) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator*=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1392,13 +1290,9 @@ slice_array<_Tp>::operator*=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator/=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1407,13 +1301,9 @@ slice_array<_Tp>::operator/=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator%=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1422,13 +1312,9 @@ slice_array<_Tp>::operator%=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator+=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1437,13 +1323,9 @@ slice_array<_Tp>::operator+=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator-=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1452,13 +1334,9 @@ slice_array<_Tp>::operator-=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator^=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1467,13 +1345,9 @@ slice_array<_Tp>::operator^=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator&=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1482,13 +1356,9 @@ slice_array<_Tp>::operator&=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator|=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1497,13 +1367,9 @@ slice_array<_Tp>::operator|=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator<<=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1512,13 +1378,9 @@ slice_array<_Tp>::operator<<=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 slice_array<_Tp>::operator>>=(const _Expr& __v) const
 {
     value_type* __t = __vp_;
@@ -1610,102 +1472,58 @@ private:
     valarray<size_t> __1d_;
 
 public:
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator*=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator/=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator%=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator+=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator-=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator^=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator&=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator|=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator<<=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator>>=(const _Expr& __v) const;
 
@@ -1734,13 +1552,9 @@ private:
 };
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1750,13 +1564,9 @@ gslice_array<_Tp>::operator=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator*=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1766,13 +1576,9 @@ gslice_array<_Tp>::operator*=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator/=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1782,13 +1588,9 @@ gslice_array<_Tp>::operator/=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator%=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1798,13 +1600,9 @@ gslice_array<_Tp>::operator%=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator+=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1814,13 +1612,9 @@ gslice_array<_Tp>::operator+=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator-=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1830,13 +1624,9 @@ gslice_array<_Tp>::operator-=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator^=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1846,13 +1636,9 @@ gslice_array<_Tp>::operator^=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator&=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1862,13 +1648,9 @@ gslice_array<_Tp>::operator&=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator|=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1878,13 +1660,9 @@ gslice_array<_Tp>::operator|=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator<<=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1894,13 +1672,9 @@ gslice_array<_Tp>::operator<<=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 gslice_array<_Tp>::operator>>=(const _Expr& __v) const
 {
     typedef const size_t* _Ip;
@@ -1945,102 +1719,58 @@ private:
     valarray<size_t> __1d_;
 
 public:
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator*=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator/=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator%=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator+=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator-=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator^=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator&=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator|=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator<<=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator>>=(const _Expr& __v) const;
 
@@ -2068,13 +1798,9 @@ private:
 };
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2083,13 +1809,9 @@ mask_array<_Tp>::operator=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator*=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2098,13 +1820,9 @@ mask_array<_Tp>::operator*=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator/=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2113,13 +1831,9 @@ mask_array<_Tp>::operator/=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator%=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2128,13 +1842,9 @@ mask_array<_Tp>::operator%=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator+=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2143,13 +1853,9 @@ mask_array<_Tp>::operator+=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator-=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2158,13 +1864,9 @@ mask_array<_Tp>::operator-=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator^=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2173,13 +1875,9 @@ mask_array<_Tp>::operator^=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator&=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2188,13 +1886,9 @@ mask_array<_Tp>::operator&=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator|=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2203,13 +1897,9 @@ mask_array<_Tp>::operator|=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator<<=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2218,13 +1908,9 @@ mask_array<_Tp>::operator<<=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     void
->::type
 mask_array<_Tp>::operator>>=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2301,102 +1987,58 @@ private:
     valarray<size_t> __1d_;
 
 public:
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator*=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator/=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator%=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator+=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator-=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator^=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator&=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator|=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator<<=(const _Expr& __v) const;
 
-    template <class _Expr>
-    typename enable_if
-    <
-        __is_val_expr<_Expr>::value,
-        void
-    >::type
+    template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
+    void
     _LIBCPP_INLINE_VISIBILITY
     operator>>=(const _Expr& __v) const;
 
@@ -2429,13 +2071,9 @@ private:
 };
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2444,13 +2082,9 @@ indirect_array<_Tp>::operator=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator*=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2459,13 +2093,9 @@ indirect_array<_Tp>::operator*=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator/=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2474,13 +2104,9 @@ indirect_array<_Tp>::operator/=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator%=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2489,13 +2115,9 @@ indirect_array<_Tp>::operator%=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator+=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2504,13 +2126,9 @@ indirect_array<_Tp>::operator+=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator-=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2519,13 +2137,9 @@ indirect_array<_Tp>::operator-=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator^=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2534,13 +2148,9 @@ indirect_array<_Tp>::operator^=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator&=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2549,13 +2159,9 @@ indirect_array<_Tp>::operator&=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator|=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2564,13 +2170,9 @@ indirect_array<_Tp>::operator|=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator<<=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -2579,13 +2181,9 @@ indirect_array<_Tp>::operator<<=(const _Expr& __v) const
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    void
->::type
+void
 indirect_array<_Tp>::operator>>=(const _Expr& __v) const
 {
     size_t __n = __1d_.size();
@@ -3456,13 +3054,9 @@ valarray<_Tp>::operator>>=(const value_type& __x)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator*=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3472,13 +3066,9 @@ valarray<_Tp>::operator*=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator/=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3488,13 +3078,9 @@ valarray<_Tp>::operator/=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator%=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3504,13 +3090,9 @@ valarray<_Tp>::operator%=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator+=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3520,13 +3102,9 @@ valarray<_Tp>::operator+=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator-=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3536,13 +3114,9 @@ valarray<_Tp>::operator-=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator^=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3552,13 +3126,9 @@ valarray<_Tp>::operator^=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator|=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3568,13 +3138,9 @@ valarray<_Tp>::operator|=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator&=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3584,13 +3150,9 @@ valarray<_Tp>::operator&=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator<<=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3600,13 +3162,9 @@ valarray<_Tp>::operator<<=(const _Expr& __v)
 }
 
 template <class _Tp>
-template <class _Expr>
+template <class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> >
 inline
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     valarray<_Tp>&
->::type
 valarray<_Tp>::operator>>=(const _Expr& __v)
 {
     size_t __i = 0;
@@ -3789,13 +3347,9 @@ swap(valarray<_Tp>& __x, valarray<_Tp>& __y) _NOEXCEPT
     __x.swap(__y);
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<multiplies<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<multiplies<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator*(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -3803,14 +3357,10 @@ operator*(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(multiplies<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3819,14 +3369,10 @@ operator*(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3835,13 +3381,9 @@ operator*(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<divides<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<divides<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator/(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -3849,14 +3391,10 @@ operator/(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(divides<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<divides<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3865,14 +3403,10 @@ operator/(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<divides<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3881,13 +3415,9 @@ operator/(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<modulus<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<modulus<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator%(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -3895,14 +3425,10 @@ operator%(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(modulus<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<modulus<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3911,14 +3437,10 @@ operator%(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<modulus<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3927,13 +3449,9 @@ operator%(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<plus<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<plus<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator+(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -3941,14 +3459,10 @@ operator+(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(plus<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<plus<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3957,14 +3471,10 @@ operator+(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<plus<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -3973,13 +3483,9 @@ operator+(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<minus<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<minus<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator-(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -3987,14 +3493,10 @@ operator-(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(minus<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<minus<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4003,14 +3505,10 @@ operator-(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<minus<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4019,13 +3517,9 @@ operator-(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<bit_xor<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4033,14 +3527,10 @@ operator^(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(bit_xor<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4049,14 +3539,10 @@ operator^(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4065,13 +3551,9 @@ operator^(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<bit_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4079,14 +3561,10 @@ operator&(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(bit_and<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4095,14 +3573,10 @@ operator&(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4111,13 +3585,9 @@ operator&(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<bit_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4125,14 +3595,10 @@ operator|(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(bit_or<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4141,14 +3607,10 @@ operator|(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4157,13 +3619,9 @@ operator|(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4171,14 +3629,10 @@ operator<<(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4187,14 +3641,10 @@ operator<<(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4203,13 +3653,9 @@ operator<<(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<__bit_shift_right<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4217,14 +3663,10 @@ operator>>(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__bit_shift_right<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4233,14 +3675,10 @@ operator>>(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__bit_shift_right<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4249,13 +3687,9 @@ operator>>(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<logical_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4263,14 +3697,10 @@ operator&&(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(logical_and<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4279,14 +3709,10 @@ operator&&(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4295,13 +3721,9 @@ operator&&(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<logical_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4309,14 +3731,10 @@ operator||(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(logical_or<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4325,14 +3743,10 @@ operator||(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4341,13 +3755,9 @@ operator||(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4355,14 +3765,10 @@ operator==(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(equal_to<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4371,14 +3777,10 @@ operator==(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4387,13 +3789,9 @@ operator==(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<not_equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4401,14 +3799,10 @@ operator!=(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4417,14 +3811,10 @@ operator!=(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4433,13 +3823,9 @@ operator!=(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<less<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<less<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator<(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -4447,14 +3833,10 @@ operator<(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(less<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<less<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4463,14 +3845,10 @@ operator<(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<less<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4479,13 +3857,9 @@ operator<(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<greater<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__val_expr<_BinaryOp<greater<typename _Expr1::value_type>, _Expr1, _Expr2> >
 operator>(const _Expr1& __x, const _Expr2& __y)
 {
     typedef typename _Expr1::value_type value_type;
@@ -4493,14 +3867,10 @@ operator>(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(greater<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<greater<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4509,14 +3879,10 @@ operator>(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<greater<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4525,13 +3891,9 @@ operator>(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<less_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4539,14 +3901,10 @@ operator<=(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(less_equal<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4555,14 +3913,10 @@ operator<=(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4571,13 +3925,9 @@ operator<=(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<greater_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4585,14 +3935,10 @@ operator>=(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(greater_equal<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4601,14 +3947,10 @@ operator>=(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4617,13 +3959,9 @@ operator>=(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >
 abs(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4631,13 +3969,9 @@ abs(const _Expr& __x)
     return __val_expr<_Op>(_Op(__abs_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >
 acos(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4645,13 +3979,9 @@ acos(const _Expr& __x)
     return __val_expr<_Op>(_Op(__acos_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >
 asin(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4659,13 +3989,9 @@ asin(const _Expr& __x)
     return __val_expr<_Op>(_Op(__asin_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >
 atan(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4673,13 +3999,9 @@ atan(const _Expr& __x)
     return __val_expr<_Op>(_Op(__atan_expr<value_type>(), __x));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<__atan2_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4687,14 +4009,10 @@ atan2(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>,
                _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
 atan2(const _Expr& __x, const typename _Expr::value_type& __y)
 {
     typedef typename _Expr::value_type value_type;
@@ -4703,14 +4021,10 @@ atan2(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>,
                __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
 atan2(const typename _Expr::value_type& __x, const _Expr& __y)
 {
     typedef typename _Expr::value_type value_type;
@@ -4719,13 +4033,9 @@ atan2(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >
 cos(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4733,13 +4043,9 @@ cos(const _Expr& __x)
     return __val_expr<_Op>(_Op(__cos_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >
 cosh(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4747,13 +4053,9 @@ cosh(const _Expr& __x)
     return __val_expr<_Op>(_Op(__cosh_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >
 exp(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4761,13 +4063,9 @@ exp(const _Expr& __x)
     return __val_expr<_Op>(_Op(__exp_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >
 log(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4775,13 +4073,9 @@ log(const _Expr& __x)
     return __val_expr<_Op>(_Op(__log_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >
->::type
+__val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >
 log10(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4789,13 +4083,9 @@ log10(const _Expr& __x)
     return __val_expr<_Op>(_Op(__log10_expr<value_type>(), __x));
 }
 
-template<class _Expr1, class _Expr2>
+template<class _Expr1, class _Expr2, __enable_if_t<__is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
-    __val_expr<_BinaryOp<__pow_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
->::type
+__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;
@@ -4803,14 +4093,10 @@ pow(const _Expr1& __x, const _Expr2& __y)
     return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>,
-               _Expr, __scalar_expr<typename _Expr::value_type> > >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4819,14 +4105,10 @@ pow(const _Expr& __x, const typename _Expr::value_type& __y)
                            __x, __scalar_expr<value_type>(__y, __x.size())));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
-    __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>,
-               __scalar_expr<typename _Expr::value_type>, _Expr> >
->::type
+__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)
 {
     typedef typename _Expr::value_type value_type;
@@ -4835,13 +4117,9 @@ pow(const typename _Expr::value_type& __x, const _Expr& __y)
                            __scalar_expr<value_type>(__x, __y.size()), __y));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_UnaryOp<__sin_expr<typename _Expr::value_type>, _Expr> >
->::type
 sin(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4849,13 +4127,9 @@ sin(const _Expr& __x)
     return __val_expr<_Op>(_Op(__sin_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_UnaryOp<__sinh_expr<typename _Expr::value_type>, _Expr> >
->::type
 sinh(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4863,13 +4137,9 @@ sinh(const _Expr& __x)
     return __val_expr<_Op>(_Op(__sinh_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_UnaryOp<__sqrt_expr<typename _Expr::value_type>, _Expr> >
->::type
 sqrt(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4877,13 +4147,9 @@ sqrt(const _Expr& __x)
     return __val_expr<_Op>(_Op(__sqrt_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_UnaryOp<__tan_expr<typename _Expr::value_type>, _Expr> >
->::type
 tan(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;
@@ -4891,13 +4157,9 @@ tan(const _Expr& __x)
     return __val_expr<_Op>(_Op(__tan_expr<value_type>(), __x));
 }
 
-template<class _Expr>
+template<class _Expr, __enable_if_t<__is_val_expr<_Expr>::value, int> = 0>
 inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
-    __is_val_expr<_Expr>::value,
     __val_expr<_UnaryOp<__tanh_expr<typename _Expr::value_type>, _Expr> >
->::type
 tanh(const _Expr& __x)
 {
     typedef typename _Expr::value_type value_type;

diff  --git a/libcxx/include/vector b/libcxx/include/vector
index 139e4d13c1e7bf..08a5d8bc97c056 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -2198,17 +2198,11 @@ public:
     vector& operator=(vector&& __v)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
 
-    template <class _InputIterator>
-        typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
-           void
-        >::type
+    template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+    void
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_InputIterator __first, _InputIterator __last);
-    template <class _ForwardIterator>
-        typename enable_if
-        <
-            __has_forward_iterator_category<_ForwardIterator>::value,
-           void
-        >::type
+    template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+    void
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_ForwardIterator __first, _ForwardIterator __last);
 
 #if _LIBCPP_STD_VER >= 23
@@ -2332,17 +2326,11 @@ public:
 
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x);
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, size_type __n, const value_type& __x);
-    template <class _InputIterator>
-        typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
-            iterator
-        >::type
+    template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
+        iterator
         _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
-    template <class _ForwardIterator>
-        typename enable_if
-        <
-            __has_forward_iterator_category<_ForwardIterator>::value,
-            iterator
-        >::type
+    template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
+        iterator
         _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
 
 #if _LIBCPP_STD_VER >= 23
@@ -2924,10 +2912,9 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
 }
 
 template <class _Allocator>
-template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
-   void
->::type
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+void
 vector<bool, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
 {
   __assign_with_sentinel(__first, __last);
@@ -2943,13 +2930,9 @@ void vector<bool, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentin
 }
 
 template <class _Allocator>
-template <class _ForwardIterator>
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
 _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    __has_forward_iterator_category<_ForwardIterator>::value,
-   void
->::type
+void
 vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
 {
   __assign_with_size(__first, __last, std::distance(__first, __last));
@@ -3090,10 +3073,9 @@ vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const
 }
 
 template <class _Allocator>
-template <class _InputIterator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
-    typename vector<bool, _Allocator>::iterator
->::type
+template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
+_LIBCPP_CONSTEXPR_SINCE_CXX20
+typename vector<bool, _Allocator>::iterator
 vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
 {
   return __insert_with_sentinel(__position, __first, __last);
@@ -3140,13 +3122,9 @@ vector<bool, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inp
 }
 
 template <class _Allocator>
-template <class _ForwardIterator>
+template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
 _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
-    __has_forward_iterator_category<_ForwardIterator>::value,
-    typename vector<bool, _Allocator>::iterator
->::type
+typename vector<bool, _Allocator>::iterator
 vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
 {
   return __insert_with_size(__position, __first, __last, std::distance(__first, __last));


        


More information about the libcxx-commits mailing list