The type_traits library offers the possibility to check if two type are the same with is_same
.
How can one generalize to an arbitrary long list of types? Something declared as
template <class... U>
struct is_same_many;
with a field value
such that value = true
if all U
s are the same, and false
otherwise.