error: no matching function for call to 'getVectort(std::ifstream&, const long int&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >&)'
Still not compiling; thanks for the reminder on that, though. I combined them into one .h file and removed the .cpp file from my configuration. I appear to be getting the same error:
error: no matching function for call to 'getVectort(std::ifstream&, const long int&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >&)'
Is there something wrong with the way I defined the template parameter?
EDIT:
Just to experiment, I removed all arguments except for the iterator from the function definition, and the call to it. Effectively the same error message.
And the body of your function doesn't change, except when you have to explicitly use the typename T (like during instantiation). However, I also saw that in your original code you set
*iter++ = temp;
Where temp is an int32_t regardless of the template parameter type. Seems wrong.
Where temp is an int32_t regardless of the template parameter type. Seems wrong.
this statement seems confusing to me please can you elobrate And also i suppose the return type you have put is int ... which should be T .
correct me if i am wrong.
Thanks in advance .