I am finding that variadic templates are quite useful for typesafety of functions with variable length of argments, but I am having much less success using then with struct especially with typelists.
Is it possible to 1) count 2) extract types in/from a typelist using variadic templates.
I tried with GNU G++ something like this but it didn't work.
template <typename T, typename... Ts>
struct count{
enum{value = 1 + count<Ts...>::value};
};
template<> count<T>{
enum{value=1;}
};
Any suggestions?
Is it possible?