Skip to content

Commit 4038d73

Browse files
d0kAlexisPerry
authored andcommitted
Revert "[libc++] Use _If for conditional_t (llvm#96193)"
This reverts commit 2274c66. It makes libc++ non-conforming, see discussion on the PR.
1 parent 321d0b2 commit 4038d73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libcxx/include/__type_traits/conditional.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
4444
using type _LIBCPP_NODEBUG = _Then;
4545
};
4646

47-
template <bool _Bp, class _IfRes, class _ElseRes>
48-
using __conditional_t _LIBCPP_NODEBUG = _If<_Bp, _IfRes, _ElseRes>;
49-
5047
#if _LIBCPP_STD_VER >= 14
5148
template <bool _Bp, class _IfRes, class _ElseRes>
52-
using conditional_t _LIBCPP_NODEBUG = __conditional_t<_Bp, _IfRes, _ElseRes>;
49+
using conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _IfRes, _ElseRes>::type;
5350
#endif
5451

52+
// Helper so we can use "conditional_t" in all language versions.
53+
template <bool _Bp, class _If, class _Then>
54+
using __conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _If, _Then>::type;
55+
5556
_LIBCPP_END_NAMESPACE_STD
5657

5758
#endif // _LIBCPP___TYPE_TRAITS_CONDITIONAL_H

0 commit comments

Comments
 (0)