Hi i need to get the type of the vector which is inside my structure and ai need to asign it to a variable but i don't quite get how to do it.
thnx baxyCode:#include <iostream> #include <vector> using namespace std; struct K{ vector<long> f; }; template <typename Z> void func (Z &x) { // here i would like that my k is of type long as a value inside vector<long> f; typename Z::typeof(x.f)::value_type k; k = x.f[0]; //cout << sizeof(x.f) << " " << sizeof(k)<< " " << x.f[0] << " " << k << "\n"; } int main (){ K x; x.f.reserve(3); x.f[0] = 7; x.f[1] = 78; x.f[2] = 5; func (x); }