I am still not familiar with the subtleties of these but weaknessforcats, somehow your post#7 seems to me a different thing. Because in your example you already declare and define a class AI. So computer has no problem, recognizinf list<AI>. Whereas when AI is going to be determined when a template is initiated we are having additional problems when we write list<AI>.
The originakl problem was that:
list<AI>::const_iterator it;
was not compiling.
This looks like you want to create an const iterator object, it, for a list<AI>. You know, so you can:
-
list<AI> mylist;
-
list<AI>::const_iterator it = mylist.begin();
-
That is what my post #7 was about.
This:
-
typename list<AI>::const_iterator it;
-
only works if it is inside a template. You can't use typename outside a template. The original problem said nothing about the code being inside a template.