Reputation: 7598
When I try to compile this I get this error:
error: expected `;' before 'it'
Why I can't declare this iterator? Where is the problem?
#include <list>
template <typename Z>
class LBFuncBase: public LBBaseBlock<Z>
{
void Something() {
std::list<LBBaseBlock< Z >* >::iterator it;
}
};
Upvotes: 2
Views: 2230
Reputation: 6981
Try:
typename std::list<LBBaseBlock< Z >* >::iterator it;
Edit:
See "Why do you sometimes need to write typename" for an explanation.
Upvotes: 13