@@ -768,20 +768,34 @@ namespace nonstd {
768768template <bool Condition, typename T = void >
769769struct enable_if : std::enable_if<Condition, T> {};
770770
771+ template <bool Condition, typename T = void >
772+ using enable_if_t = typename enable_if<Condition, T>::type;
773+
771774}
772775
773776template <typename T>
774777typename nonstd::enable_if<some_type_trait<T>::value, void >::type nonstd_enable_if () {}
775778// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
776779// CHECK-FIXES: {{^}}void nonstd_enable_if() requires some_type_trait<T>::value {}{{$}}
777780
781+ template <typename T>
782+ nonstd::enable_if_t <some_type_trait<T>::value, void > nonstd_enable_if_t () {}
783+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
784+ // CHECK-FIXES: {{^}}void nonstd_enable_if_t() requires some_type_trait<T>::value {}{{$}}
785+
778786// But only if the non-standard enable_if has the same signature as the standard one.
779787namespace boost {
780788
781789template <typename Condition, typename T = void >
782790struct enable_if : std::enable_if<Condition::value, T> {};
783791
792+ template <typename Condition, typename T = void >
793+ using enable_if_t = typename enable_if<Condition, T>::type;
794+
784795}
785796
786797template <typename T>
787798typename boost::enable_if<some_type_trait<T>, void >::type boost_enable_if () {}
799+
800+ template <typename T>
801+ boost::enable_if_t <some_type_trait<T>, void > boost_enable_if_t () {}
0 commit comments