diff --git a/octa/type_traits.hh b/octa/type_traits.hh index 0438b9e..4466ba8 100644 --- a/octa/type_traits.hh +++ b/octa/type_traits.hh @@ -67,6 +67,50 @@ 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 {}; + /* is void */ namespace detail { @@ -1193,6 +1237,7 @@ namespace detail { template using UnderlyingType = typename detail::UnderlyingTypeBase::Type; + } /* namespace octa */ #endif \ No newline at end of file