12 using bool_t = std::integral_constant<bool, B>;
16 constexpr bool_t<B> bool_ = {};
22 constexpr bool all_of_v = (Bs && ...);
25 using all_of_t = bool_t<all_of_v<Bs...>>;
28 using and_t = all_of_t<Bs...>;
31 constexpr bool any_of_v = (Bs || ...);
34 using any_of_t = bool_t<any_of_v<Bs...>>;
37 using or_t = any_of_t<Bs...>;
40 constexpr bool none_of_v = !(Bs || ...);
43 using none_of_t = bool_t<none_of_v<Bs...>>;
47 constexpr all_of_t<Bs...> and_ = {};
49 template <
bool B0,
bool B1>
50 constexpr bool_t<B0 && B1> operator&&(bool_t<B0>, bool_t<B1>) {
return {}; }
54 constexpr any_of_t<Bs...> or_ = {};
56 template <
bool B0,
bool B1>
57 constexpr bool_t<B0 || B1> operator||(bool_t<B0>, bool_t<B1>) {
return {}; }
61 using not_t = bool_t<!B>;
64 constexpr bool_t<!B> not_ = {};
67 constexpr bool_t<!B> operator!(bool_t<B>) {
return {}; }
72 template <
class T, T... Is>
75 template <
class T, T I0, T... Is>
76 struct IsEqualImpl<T, I0, Is...>
77 :
public std::is_same<std::integer_sequence<T,I0,Is...>,
78 std::integer_sequence<T,Is...,I0>> {};
81 struct IsEqualImpl<T> {
enum { value =
true }; };
85 template <
class T, T... values>
86 using IsEqual = Impl::IsEqualImpl<T,values...>;
88 template <
class T,
class... Ts>
89 using is_one_of = or_t<std::is_same_v<T, Ts>...>;