std::list iterator problem
Hello I have the following problem:
When writing this code:
typedef std::list<boost::shared_ptr<OctreeNode<T> > > RootNodeList;
RootNodeList::iterator i;
The compiler outputs the this error:
Error: expected `;' before »i«
Where the hell does this come from?
thx in advance
Try changing it to typename RootNodeList::iterator i;
Because RootNodeList::iterator could be either a member or a type (depending on T) you have to tell the compiler to treat it as a type.
The error message isn't very helpful though.
Because RootNodeList::iterator could be either a member or a type (depending on T) you have to tell the compiler to treat it as a type.
The error message isn't very helpful though.
Ok changed to typename but now I get another error when I try to create a list from this type:
RootNodeList m_rootNodes;
The compiler says that RootNodeList does not name a type.
RootNodeList m_rootNodes;
The compiler says that RootNodeList does not name a type.
Same basic problem as dicussed in this thread.
The following should work:
typename RootNodeList::iterator i;
The following should work:
typename RootNodeList::iterator i;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement