I've tried the following program on two different compilers (VC++ 7.1 and
gcc 3.3.1) and both print "first" when I expected "second". Why is that?
#include <vector>
#include <iostream>
template <class Iter>
void func(Iter i)
{
std::cout << "first\n";
}
template <class T>
void func(typename std::vector<T>::iterator i)
{
std::cout << "second\n";
}
int main()
{
std::vector<int> v;
func(v.begin());
}
john