diff --git a/misc/traits.h b/misc/traits.h index 45af476..b956ab7 100644 --- a/misc/traits.h +++ b/misc/traits.h @@ -30,6 +30,11 @@ 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; diff --git a/tests/traitstests.cpp b/tests/traitstests.cpp index 5c838e1..23ddb13 100644 --- a/tests/traitstests.cpp +++ b/tests/traitstests.cpp @@ -28,6 +28,9 @@ static_assert(!Any, Bool>::value, "Any: negative case"); static_assert(Any, Bool>::value, "Any: positive case"); static_assert(!All, Bool>::value, "All: negative case"); static_assert(All, Bool>::value, "All: positive case"); +static_assert(!None, Bool>::value, "None: negative case"); +static_assert(!None, Bool>::value, "None: negative case"); +static_assert(None, Bool>::value, "None: positive case"); static_assert(!IsSpecializationOf::value, "IsSpecializationOf: negative case"); static_assert(IsSpecializationOf::value, "IsSpecializationOf: positive case");