I have been trying to reinforce my knowledge of templates lately, and was unable to get the following to compile.
My compiler is gcc 4.1.3, and the error isCode:#include <iostream> #include <list> using namespace std; template <class T> class A { }; template <class T> class B { B() { std::list< A< T > >::const_iterator i; } }; int main(void) { B<int> a(); return 0; }
What am I doing wrong?Code:test.cpp: In constructor ‘B<T>::B()’: test.cpp:11: error: expected `;' before ‘i’
Thanks!