Why do people use enums in C++ as constants while they can use const?
Bruce Eckel gives a reason in Thinking in C++: In older versions of C++, static const was not supported inside classes. This meant that const was useless for constant expressions inside classes. However, people still wanted to do this so a typical solution (usually referred to as the “enum hack”) was to use an untagged … Read more