Add Traits::IsSpecializingAnyOf
This commit is contained in:
parent
0fb92e3685
commit
27d5041e06
|
@ -45,6 +45,12 @@ template <typename T, template <typename...> class Template> struct IsSpecializa
|
|||
};
|
||||
template <template <typename...> class Template, typename... Args> struct IsSpecializationOf<Template<Args...>, Template> : Bool<true> {
|
||||
};
|
||||
template <typename Type, template <typename...> class... TemplateTypes> struct IsSpecializingAnyOf : Bool<false> {
|
||||
};
|
||||
template <typename Type, template <typename...> class TemplateType, template <typename...> class... RemainingTemplateTypes>
|
||||
struct IsSpecializingAnyOf<Type, TemplateType, RemainingTemplateTypes...>
|
||||
: Conditional<IsSpecializationOf<Type, TemplateType>, Bool<true>, IsSpecializingAnyOf<Type, RemainingTemplateTypes...>> {
|
||||
};
|
||||
|
||||
template <typename... T> struct IsAnyOf : Bool<false> {
|
||||
};
|
||||
|
|
|
@ -34,6 +34,11 @@ static_assert(None<Bool<false>, Bool<false>>::value, "None: positive case");
|
|||
|
||||
static_assert(!IsSpecializationOf<string, basic_stringbuf>::value, "IsSpecializationOf: negative case");
|
||||
static_assert(IsSpecializationOf<string, basic_string>::value, "IsSpecializationOf: positive case");
|
||||
static_assert(!IsSpecializingAnyOf<string, basic_stringbuf, vector>::value, "IsSpecializingAnyOf: negative case");
|
||||
static_assert(!IsSpecializingAnyOf<string, basic_stringbuf, list, vector>::value, "IsSpecializingAnyOf: negative case");
|
||||
static_assert(IsSpecializingAnyOf<string, basic_stringbuf, basic_string, vector>::value, "IsSpecializingAnyOf: positive case");
|
||||
static_assert(IsSpecializingAnyOf<string, basic_stringbuf, vector, basic_string>::value, "IsSpecializingAnyOf: positive case");
|
||||
static_assert(IsSpecializingAnyOf<string, basic_string>::value, "IsSpecializingAnyOf: positive case");
|
||||
|
||||
static_assert(IsAnyOf<string, string, int, bool>::value, "IsAnyOf: positive case");
|
||||
static_assert(IsAnyOf<int, string, int, bool>::value, "IsAnyOf: positive case");
|
||||
|
|
Loading…
Reference in New Issue