How do I get the value_type
of the inner-most of an n-dimensional vector?
In particular, I would like to each time obtain type_name
to be double
for the example as follows:
#include <vector>
template <class T>
void foo(const T& data)
{
// ??
using type_name = typename T::value_type;
type_name a;
}
int main()
{
std::vector<std::vector<double>> a;
std::vector<std::vector<std::vector<double>>> b;
foo(a);
foo(b);
return 0;
}