C ++ 11の厳密に型指定された列挙型を持たないVS2010を使用しています。強い型付けはなくても大丈夫ですが、やはり、クラスの名前空間から列挙型を除外したいと考えています。
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
}
};
私の質問は、これを達成するための最良の方法は何ですか?