10.4 — Scoped enumerations (enum classes)
Although unscoped enumerations are distinct types in C++, they are not type safe, and in some cases will allow you to do things that don’t make sense. Consider the following case: #include <iostream> int main() { enum Color { red, blue, }; enum Fruit { banana, apple, }; Color color …