Skip to content

Commit

Permalink
Revert "[libc++] Use _If for conditional_t (llvm#96193)"
Browse files Browse the repository at this point in the history
This reverts commit 2274c66. It makes
libc++ non-conforming, see discussion on the PR.
  • Loading branch information
d0k authored and lravenclaw committed Jul 3, 2024
1 parent cf093be commit 3a53d06
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libcxx/include/__type_traits/conditional.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
using type _LIBCPP_NODEBUG = _Then;
};

template <bool _Bp, class _IfRes, class _ElseRes>
using __conditional_t _LIBCPP_NODEBUG = _If<_Bp, _IfRes, _ElseRes>;

#if _LIBCPP_STD_VER >= 14
template <bool _Bp, class _IfRes, class _ElseRes>
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 <bool _Bp, class _If, class _Then>
using __conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _If, _Then>::type;

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___TYPE_TRAITS_CONDITIONAL_H

0 comments on commit 3a53d06

Please sign in to comment.