From 379cd1193a8453850f0c2e12c005160d7535b373 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Wed, 26 Jun 2024 23:57:04 -0400 Subject: [PATCH] Revert "[libc++] Use _If for conditional_t (#96193)" This reverts commit 2274c66e6faaaf29ad693b1ae3e5a7b0228a1950. --- libcxx/include/__type_traits/conditional.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libcxx/include/__type_traits/conditional.h b/libcxx/include/__type_traits/conditional.h index 7d5849ee824e3f..5b5445a8374271 100644 --- a/libcxx/include/__type_traits/conditional.h +++ b/libcxx/include/__type_traits/conditional.h @@ -44,14 +44,15 @@ struct _LIBCPP_TEMPLATE_VIS conditional { using type _LIBCPP_NODEBUG = _Then; }; -template -using __conditional_t _LIBCPP_NODEBUG = _If<_Bp, _IfRes, _ElseRes>; - #if _LIBCPP_STD_VER >= 14 template -using conditional_t _LIBCPP_NODEBUG = __conditional_t<_Bp, _IfRes, _ElseRes>; +using conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _IfRes, _ElseRes>::type; #endif +// Helper so we can use "conditional_t" in all language versions. +template +using __conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _If, _Then>::type; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_CONDITIONAL_H