How can I get the number of 'nested' template arguments of a type in c++?
I would like to write a function GetNumberOfTypes<T>() that returns the number of template arguments of T:
constexpr int a = GetNumberOfTypes<int>(); //a == 0
constexpr int b = GetNumberOfTypes<std::vector<int>>(); //b == 1
constexpr int c = GetNumberOfTypes<std::tuple<int,int>>(); //c == 2
Can this be accomplished somehow? I've messed around with sizeof..., but I don't really know what I'm doing...