I have some type traits SomeTraits
from which I can extract whether a type T
fulfills some condition, through SomeTraits<T>::value
.
How would one go over all the types of a given std::tuple<>
and check (through say a static assert) whether they all fulfill the above condition? e.g.
using MyTypes = std::tuple<T1, T2, T3>;
// Need some way to do something like
static_assert(SomeTupleTraits<MyTypes>::value, "MyTypes must be a tuple that blabla...");
where SomeTupleTraits
would check whether SomeTraits<T>::value == true
for each type inside MyTypes
?
I am restricted to C++14.