xieite::is_same_any<>

Defined in header <xieite/trait/is_same_any.hpp>

Specifies that a type is the same as at least one of several other types.


Declaration

template<typename... Ts>
concept is_same_any = (... || std::same_as<Ts...[0], Ts>);


Example

template<typename T>
concept test = xieite::is_same_any<T, int, char, float>;

static_assert(test<int>);
static_assert(test<float>);
static_assert(!test<void>);
[View in Compiler Explorer]