tags:

views:

101

answers:

1

When I try to compile this I get this error:

error: expected `;' before 'it'

Why I can't declare this iterator? I don't understand...

#include <list>

template <typename Z>
class LBFuncBase: public LBBaseBlock<Z>
{
    void Something() {
         std::list<LBBaseBlock< Z >* >::iterator it;
    }
}
+9  A: 

Try:

typename std::list<LBBaseBlock< Z >* >::iterator it;

Edit:

See "Why do you sometimes need to write typename" for an explanation.

Mic
You beat me by 7 seconds...
Aaron
Lucky me, I'm usually at least 7 seconds late :).
Mic