views:

46

answers:

1
+4  A: 

std::vector<T>::iterator is a type that is dependent on a template parameter, namely T. Therefore, you should prefix with it typename:

template<typename T>
void foo(typename std::vector<T>::iterator & i)
{  
}

Here's an explanation.

GMan
+1 Faster than me.
Fred Larson
@Fred: I'm maxed so I'm shooting fast for accepted answers. :P
GMan
@GMan: Haha, I shall accept your answer tomorrow then :) (so that you can get +15)
Jacob
@Jacob: Accepted answers are immune to the limit: http://stackoverflow.com/faq
eldarerathis