GCC compiler doesn't like this, what am I doing wrong?

Started by
1 comment, last by pauls_1979 15 years, 6 months ago
Here's an extremely simplified example of some code from my multi-platform game engine.

template <typename TYPE> class List
{
	public:
	
		class Node
		{
			TYPE	object;
		};
};

template <typename TYPE> class ResourceManager
{
	public:
	
		typedef List<TYPE> ResourceList;
	
		void DoSomething()
		{
			ResourceList::Node	node; // Here's where I get the error.
		}
};

This isn't new code, and I've compiled it many times before (using both Visual Studio and Codewarrior) without any problems. Now I'm trying to compile it for the IPhone (which uses the gcc compiler), and I get this error: ResourceList::Node node; - expected `;' before 'node' I'm assuming this relates to a c++ standard that hasn't been properly supported by the other compilers, but can anybody suggest what I might be doing wrong, and how I might fix it. Thanks in advance.
Advertisement
Dependent qualified typenames need to be prefixed by the typename keyword. Ex:
typename ResourceList::Node node;
Thanks, that worked a treat.

This topic is closed to new replies.

Advertisement