Hi, I'm trying to get my head around why the following doesn't work. I have a std::vector and I want to call a static member function of it's contained value_type like so:
std::vector<Vector> v;
unsigned u = v.value_type::Dim();
where Vector is in fact a typedef for a templated type:
template <typename T, unsigned U> class SVector;
typedef SVector<double, 2> Vector; //two-dimensional SVector containing doubles
and the static member function Dim() actually inlines the dimensionality U of the Vector.
Now the compiler returns an error message saying:
error: ‘SVector<double, 2u>’ is not a base of
‘std::vector<SVector<double, 2u>, std::allocator<SVector<double, 2u> > >
which puzzles me. I can replace the apparently offending line by
unsigned u = Vector::Dim();
and that works, but is obviously ugly as it hardcodes assumptions about the value_type of v... Thanks!