[PATCH] D45805: [libcxx] Remove redundant specializations in type_traits.

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 19 00:07:39 PDT 2018


MaskRay created this revision.
Herald added a reviewer: EricWF.
Herald added subscribers: cfe-commits, christof.

Repository:
  rCXX libc++

https://reviews.llvm.org/D45805

Files:
  include/type_traits


Index: include/type_traits
===================================================================
--- include/type_traits
+++ include/type_traits
@@ -553,9 +553,6 @@
 template <>
 struct __lazy_and_impl<true> : true_type {};
 
-template <class _Pred>
-struct __lazy_and_impl<true, _Pred> : integral_constant<bool, _Pred::type::value> {};
-
 template <class _Hp, class ..._Tp>
 struct __lazy_and_impl<true, _Hp, _Tp...> : __lazy_and_impl<_Hp::type::value, _Tp...> {};
 
@@ -591,25 +588,19 @@
 
 template<class _B0> struct __and_<_B0> : _B0 {};
 
-template<class _B0, class _B1>
-struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {};
-
-template<class _B0, class _B1, class _B2, class... _Bn>
-struct __and_<_B0, _B1, _B2, _Bn...> 
-        : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {};
+template<class _B0, class _B1, class... _Bn>
+struct __and_<_B0, _B1, _Bn...>
+        : conditional<_B0::value, __and_<_B1, _Bn...>, _B0>::type {};
 
 // __or_
 template<class...> struct __or_;
 template<> struct __or_<> : false_type {};
 
 template<class _B0> struct __or_<_B0> : _B0 {};
 
-template<class _B0, class _B1>
-struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {};
-
-template<class _B0, class _B1, class _B2, class... _Bn>
-struct __or_<_B0, _B1, _B2, _Bn...> 
-        : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {};
+template<class _B0, class _B1, class... _Bn>
+struct __or_<_B0, _B1, _Bn...>
+        : conditional<_B0::value, _B0, __or_<_B1, _Bn...> >::type {};
 
 // __not_
 template<class _Tp> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45805.143051.patch
Type: text/x-patch
Size: 1571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180419/7603b9a1/attachment.bin>


More information about the cfe-commits mailing list