I have this code:
template <typename T>
class CircularBuffer
{
public:
typename typedef std::list<T>::iterator iterator;
//other code
};
What does the typename in the iterator declaration do? I know the typedef is saying "I have a list iterator that i want to call 'iterator'. But what is the purpose of the typename? Is it just cause my list can store any typename T that I need it? Is it for something else?
Thanks,
Tom
Edit: Is it because the list iterator is a qualified dependent type, and so I need typename before it? Or, more correctly, the typedef I am defining, 'iterator' which is based on the type std::list::iterator is a qualified dependent type since it is an iterator of a qualified dependent list?