I'd like to ask the compiler to check if a tuple contain only "meta types".
By the way I'm completely new with C++ concepts.
template < typename T >
struct Type {
using type = T;
};
//! A type can be easily check with a small concept
template < typename T >
concept bool C_Type = requires {
typename T::type;
};
//! But how to apply it on a whole tuple?
template < typename T >
void foo(T tuple) {}
int main() {
constexpr auto test = std::make_tuple(Type<int>{}, Type<double>{});
foo(test);
}
So I want to be sure that every type inside the sequence (let's say only something Iterable for this example) is a "meta type".
I'm using Boost Hana if it can simplify the code.
At the moment I'm not even sure if it's possible. I hope it is, I guess I just need to learn more meta-programming stuff. So I'll continue to search and try, but if somebody already has the answer, thanks!