#ifndef CPP_UTILITIES_TRAITS_H #define CPP_UTILITIES_TRAITS_H #include #include /// \brief Contains traits for conveniently exploiting SFINAE. namespace Traits { /// \cond namespace Detail { enum class Enabler {}; } /// \endcond template using Conditional = typename std::conditional::type; template struct Bool : std::integral_constant { }; template using Not = Bool; template struct Any : Bool { }; template struct Any : Conditional, Any> { }; template struct All : Bool { }; template struct All : Conditional, Bool> { }; template struct None : Bool { }; template struct None : Conditional, None> { }; template using EnableIf = typename std::enable_if::value, Detail::Enabler>::type; template using DisableIf = typename std::enable_if::value, Detail::Enabler>::type; template using EnableIfAny = typename std::enable_if::value, Detail::Enabler>::type; template using DisableIfAny = typename std::enable_if::value, Detail::Enabler>::type; template class Template> struct IsSpecializationOf : Bool { }; template