tags:

views:

45

answers:

1

Hello,

I make stack based in std:list. Now i try to make functions for showing all elements from this stack:

I try to declare iterator:

void show_elements()
{
    list<T>::iterator it;
}

But i get error: error: dependent-name ‘std::list::iterator’ is parsed as a non-type, but instantiation yields a type

What's wrong?

Thank you.

+7  A: 

You need atypename:

typename list<T>::iterator it; 
James McNellis
Yes, thank you very much, it's helpfull
shk