From 37059e505b6ef0ad5046fca752571bced88573de Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 14 Jan 2016 19:32:22 +0000 Subject: [PATCH] remove some unnecessary code --- ostd/tuple.hh | 16 ++++++---------- ostd/type_traits.hh | 44 -------------------------------------------- 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/ostd/tuple.hh b/ostd/tuple.hh index f14c682..cea2d5c 100644 --- a/ostd/tuple.hh +++ b/ostd/tuple.hh @@ -53,10 +53,9 @@ namespace detail { "attempt to default construct a reference element in a tuple"); } - template, TupleLeaf>>>, - IntegralConstant> - >::value>> + template, TupleLeaf> && IsConstructible + >> explicit TupleLeaf(T &&t): p_value(forward(t)) { static_assert(!IsReference || (IsLvalueReference && @@ -136,12 +135,9 @@ namespace detail { template TupleLeaf(IntegralConstant, const A &a): H(a) {} - template, TupleLeaf>>>, - IntegralConstant> - >::value> - > explicit TupleLeaf(T &&t): H(forward(t)) {} + template, TupleLeaf> && IsConstructible + >> explicit TupleLeaf(T &&t): H(forward(t)) {} template explicit TupleLeaf(IntegralConstant, const A &, T &&t): diff --git a/ostd/type_traits.hh b/ostd/type_traits.hh index c14d719..5952e90 100644 --- a/ostd/type_traits.hh +++ b/ostd/type_traits.hh @@ -64,50 +64,6 @@ using False = IntegralConstant; template constexpr T IntegralConstant::value; -/* and */ - -namespace detail { - template struct AndBase; - - template - struct AndBase: False {}; - - template<> - struct AndBase: True {}; - - template - struct AndBase: IntegralConstant {}; - - template - struct AndBase: AndBase {}; -} - -template -struct And: detail::AndBase {}; - -/* or */ - -namespace detail { - template struct OrBase; - - template<> - struct OrBase: False {}; - - template - struct OrBase: OrBase {}; - - template - struct OrBase: True {}; -} - -template -struct Or: detail::OrBase {}; - -/* not */ - -template -struct Not: IntegralConstant {}; - /* type equality */ template constexpr bool IsSame = false;