Sign in to follow this  

Standardized queue Template class error in VS.

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

This topic is 4690 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this