Template class with a template member...
I am trying to create a template class that passes its template down to a member that is also a template class, as in this example:
Code:
#include <list> vu.cc: In constructor `Foo<T>::Foo()': vu.cc:8: error: expected `;' before "i" What is the correct way to do something like this? |
Well, I think I've found a solution:
Code:
#include <list> |
Because the compiler doesn't know whether ::iterator is a type or a value, so you need to give it a helping hand.
Code:
template <typename T> HTH |
No, I didn't get any other messages from the compiler.
Thanks for the explanation, it makes a lot more sense now. |
All times are GMT -5. The time now is 08:38 PM. |