>Visual C++ dislikes this.
Any conforming C++ compiler should dislike it.
>Is this just VC being an incredible pain or is there a good reason for this?
There's a good reason. Without going into excessive detail, because std::vector<T>::iterator is a qualified name that's dependent on the template argument T, there's an ambiguity there where the compiler could recognize the line as either a declaration or a statement and both are equally good choices. The typename keyword is for disambiguation so that you can say "yes, this really is a type".
Last edited by Narue; Oct 22nd, 2008 at 3:58 pm.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004