   Advanced Templates VS2003 Question
  Hi All -I'm designing a templated "Sequence" class, and it won't let me compile a particular line of code...template <class T, class NUMERIC=float>class SequenceEvent;template <class T, class NUMERIC=float>class Sequence{    typedef std::vector<SequenceEvent<T, NUMERIC> > SequenceContainer;  //compiles fine    typedef std::vector<SequenceEvent<T, NUMERIC> >::iterator  SequenceIter;  //Compiler Error   // typedef std::vector<int>::iterator  SequenceIter;  //would compile fine....}; I know that the templated typedef namespace stuff is pretty hard on the compiler, but this should be legal C++. I'm basing my design off of some of Andrei Alexandrescu's code.  It's not compiling under VS 2003 or VS 2005.  Does anyone have any idea what I can do to get around this?  The basic idea is that I want the Sequence to be able to return iterators to SequenceEvents in other Sequence functions, but I want to be able to swap out the container tha the Sequence uses fairly easily.Thanks for any help!   
  Try:typedef typename std::vector<SequenceEvent<T, NUMERIC> >::iterator  SequenceIter;A Google search for, say, 'c++ typename dependent name' will most likely lead you to an explanation of why the typename keyword is necessary here.   ;  You need the typename keyword.template <class T, class NUMERIC=float>class SequenceEvent;template <class T, class NUMERIC=float>class Sequence{    typedef std::vector<SequenceEvent<T, NUMERIC> > SequenceContainer;  //compiles fine    typedef typename std::vector<SequenceEvent<T, NUMERIC> >::iterator  SequenceIter;  //Compiler Error   // typedef std::vector<int>::iterator  SequenceIter;  //would compile fine....};;  Awesome.  You learn something new everyday, huh?Thanks, guys!   