I use VS2010 which doesn't have the strongly typed enums of C++11. The strong typing I can live without, but all the same, I'd like to keep enumerations out of my class's namespace.
class Example{
enum Color{
red,
green,
blue
};
int Rainbows{
Color x = red; // this should be impossible
Color y = Color::green; // this is the only way at the enumerations
}
};
My question, is what is the best way to accomplish this, pre-C++11?