[libcxx-commits] [PATCH] D131082: [libcxx] Add _LIBCPP_NODEBUG to std::conditional related typedfs

David Blaikie via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 22 10:56:37 PST 2022


dblaikie updated this revision to Diff 477255.
dblaikie added a comment.

Use using decls while we're here


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131082/new/

https://reviews.llvm.org/D131082

Files:
  libcxx/include/__type_traits/conditional.h


Index: libcxx/include/__type_traits/conditional.h
===================================================================
--- libcxx/include/__type_traits/conditional.h
+++ libcxx/include/__type_traits/conditional.h
@@ -36,17 +36,22 @@
 using _If _LIBCPP_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;
 
 template <bool _Bp, class _If, class _Then>
-    struct _LIBCPP_TEMPLATE_VIS conditional {typedef _If type;};
+struct _LIBCPP_TEMPLATE_VIS conditional {
+  using type _LIBCPP_NODEBUG = _If;
+};
 template <class _If, class _Then>
-    struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {typedef _Then type;};
+struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {
+  using type _LIBCPP_NODEBUG = _Then;
+};
 
 #if _LIBCPP_STD_VER > 11
 template <bool _Bp, class _IfRes, class _ElseRes>
-using conditional_t = typename conditional<_Bp, _IfRes, _ElseRes>::type;
+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 = typename conditional<_Bp, _If, _Then>::type;
+template <bool _Bp, class _If, class _Then>
+using __conditional_t _LIBCPP_NODEBUG = typename conditional<_Bp, _If, _Then>::type;
 
 _LIBCPP_END_NAMESPACE_STD
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131082.477255.patch
Type: text/x-patch
Size: 1342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221122/afd220ff/attachment.bin>


More information about the libcxx-commits mailing list