...my temple hurts.
I'm writing (potentially) template-heavy code, and I've encountered this problem which fortunately can be isolated:
Code:
#include <vector>
template <class a_type>
class a_class
{
public:
void foo()
{
std::vector <a_type>::iterator i;
}
};
Now when I try to compile this code in GCC it gives
Code:
In member function 'void a_class<a_type>::foo()': expected ';' before "i"
I'm thinking the reason is in the way the STL implements its iterators... you need a well-defined class for them. But I'm not sure.
EDIT: Okay, after fiddling around I found that using typename would resolve the error. (And finally got a chance to learn what the keyword did.) I'm still open to explanations...