I wrote a function template f
which takes a vector iterator as a parameter:
#include<vector>
using namespace std;
template <typename T>
void f(vector<T>::iterator it)
{
}
int main()
{
vector<int> v;
f(v.begin());
}
Compiling it with gcc failed, the error message is very hard to understand:
What's the cause of the compilation error and how can I fix it?