• Advertisement
Sign in to follow this  

C++ enum

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

Can an enum be declared at global scope, i.e in a header file,rather then the class body

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by SiCrane
Did you try it?


I guess he has no C++ compiler. Or no computer at all.

Share this post


Link to post
Share on other sites
I have them, I made the attempt to compile it, couldn't elaborate. It falls in the lines of with one of my other recent threads, didn't want to bother people with it much

[Edited by - Calin on April 21, 2009 2:47:45 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
Yes. The names of the items in the enum are put into the global namespace though.

I like doing something along the lines of
namespace enum_name
{
enum type
{
...
};
}

Share this post


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

  • Advertisement