Essentially, is there a shorter/cleaner way to define Alphabet
than using a bunch of std::same_as
/std::is_same
?
struct A {};
struct B {};
struct C {};
...
template <typename T>
concept Alphabet =
std::same_as<T, A> ||
std::same_as<T, B> ||
std::same_as<T, C> ||
...
You could accomplish this (sort of) by defining a base class and using std::is_base_of
, but for the sake of this question let's assume A
, B
, C
, etc. cannot be modified.