Top.Mail.Ru
The C++ Community's Journal -- Day
? ?
The C++ Community's Journal -- Day [entries|friends|calendar]
The C++ Community

[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

constants in class [06 Sep 2004|06:40pm]
Ok this may seem a bit easy but I'm trying to find out the best way.

I have some constants and I want them to reside in a class. I want to do things like:

if(thecolor == Color::RED)

What would be the best way to do this? A static member variable and its global initialization? The value of RED is irrelevent as long as it is different than other colors here. Color is just an example.
6 comments|post comment

navigation
[ viewing | September 6th, 2004 ]
[ go | previous day|next day ]
Image