Hi all,
I'm having a problem writing template functions that take
vector<T>::iterator as arguments and I'm sure you guys can set me
straight. Like this:
#include<vector>
using namespace std;
template<typename T>
void test2(typename std::vector<T>::iterator b)
{};
void test() {
vector<doublev;
test2(v.begin());
}
If compiled with g++, I get
junk.cc:11: error: no matching function for call to
'test2(__gnu_cxx::__normal_iterator<double*, std::vector<double,
std::allocator<double >)'
If I specialize the test2 function with
void test2(std::vector<double>::iterator b)
{};
it compiles fine. I don't understand why it's not picking up the
templated version.
Regards,
/Patrik