Hi - I can't seem to figure this one out, help is appreciated:
Header file:
template <class T>
class Foo {
T val;
};
template<class T>
class Bar {
T bar_func();
list < Foo<T> > val_list;
};
No complaints from the compiler on the header file, but the following will not compile:
template <class T> T Bar<T>::bar_fun c() {
list < Foo<T> >:: iterator iter;
....
}
The compiler (gnu g++) complains about the "list < Foo<T> >::iterator iter" line - specifically saying it expects a semicolon before "iter".
Is it something with the nested template?
Thanks for any help !
Header file:
template <class T>
class Foo {
T val;
};
template<class T>
class Bar {
T bar_func();
list < Foo<T> > val_list;
};
No complaints from the compiler on the header file, but the following will not compile:
template <class T> T Bar<T>::bar_fun c() {
list < Foo<T> >:: iterator iter;
....
}
The compiler (gnu g++) complains about the "list < Foo<T> >::iterator iter" line - specifically saying it expects a semicolon before "iter".
Is it something with the nested template?
Thanks for any help !
Comment