Jump to content
  • Advertisement
Sign in to follow this  
kinglink

Standardized queue Template class error in VS.

This topic is 4996 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

I keep getting the following error c:\project\Nog\Board.h(46): error C2143: syntax error : missing ';' before '<' On that file this is the surrounding lines
Quote:
CString Name; private : queue<Space* > places; //error }; //end of class
I do have #include <queue> in the file. I've seen it typed similar to that in every file I've seen (Space is defined as a class) so why does that error come up? In addition, would you suggest using CString, if not using the MFC (using DirectX) or should I just use Char* or is there a preferable class?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by kinglink
I keep getting the following error c:\project\Nog\Board.h(46): error C2143: syntax error : missing ';' before '<'

On that file this is the surrounding lines

Quote:

CString Name;
private :
queue<Space* > places; //error

}; //end of class


I do have #include <queue> in the file.

I've seen it typed similar to that in every file I've seen (Space is defined as a class)

so why does that error come up?


Could be a matter of the order in which you have things down. More context (like, a minimal complete file that demonstrates the problem) would be helpful.

Quote:
In addition, would you suggest using CString, if not using the MFC (using DirectX) or should I just use Char* or is there a preferable class?


Look at the signature.

Share this post


Link to post
Share on other sites
have you got a using statement above that somewhere? otherwise the code should be
std::queue< Space* > places;


(although this probably isn't the problem, as if it was your compiler should've also told you that 'queue' is undeclared...)

Share this post


Link to post
Share on other sites
I give up, I can't figure out the code. I'll post my class (it's a bit long but I've tried commenting out everything and it still does it so it's likely a stupid thing)

Quote:
deleted


As for std::string I couldn't seem to get it working at all, most documents on the web seem to state it's string functions but there's no actual std::String (I remember using string but then I've been doing too much Java so I might be getting mixed up)? Or if I use std::string that'll work with <string>. I'll use that puppy.

std::queue works perfectly well, I feel like an idiot, but I'm calling it a learning experience.

P.S. Second edit :This is why I don't like to edit posts, you get both sides. The final info is Both are working fine, now thank you very much. Though likely I'll make my own Queue class this helps for first builds.

[Edited by - kinglink on February 13, 2005 4:34:09 PM]

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!