Greets, Before people get too confused here by tangential topics, I'd just like to reiterate that Ian already answered the original question on 9/8, simply: that an (template) argument-dependent nested type (e.g. map<int, vector<T> >::iterator) requires the 'typename' keyword prefixed. (Earlier compiler versions didn't require it, a.k.a. implicit typenames, which is non-standard conforming.) See first bullet under: http://gcc.gnu.org/bugs.html#nonbugs_cxx The original posted code (below) has nothing to do with template argument deduction, as was alluded and mentioned in another response. > "Eric Lance" <eric.lance@xxxxxxxxx> writes: > > > I'm trying to figure out if this is a bug or "feature". In a generic > > function, I want to declare an iterator over a map whose values are > > generic vectors. However, I get a syntax error whenever I try to > > declare this particular kind of iterator. The code snippet below > > should illustrate what I mean better: > > > > template<typename T> > > void func() > > { > > map< int, vector<T> > m; //we want an iterator over m. > > map< int, vector<T> >::iterator i; //this doesn't compile > > map< int, vector<int> >::iterator k; //but this does > > } > > This is not a gcc question. In standard C++ you need to say > typename map< int, vector<T> >::iterator i; Fang