Jump to content
  • Advertisement
Sign in to follow this  
pauls_1979

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

This topic is 3663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Dependent qualified typenames need to be prefixed by the typename keyword. Ex:

typename ResourceList::Node node;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!