S
saneman
In a template class I have:
typedef std::list<V,A> list;
typedef list::iterator iterator;
but this gives a compile error. If I replace the second line with:
typedef typename list::iterator iterator;
it works. But why? I have read that typename should be used when an
expression depends on template parameters.
If that is the case why is it not necessary to use typename in the first
line?
typedef std::list<V,A> list;
typedef list::iterator iterator;
but this gives a compile error. If I replace the second line with:
typedef typename list::iterator iterator;
it works. But why? I have read that typename should be used when an
expression depends on template parameters.
If that is the case why is it not necessary to use typename in the first
line?