Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Overview ===== C++11 extensions to enums -- enum classes versus original "plain" enums (//scoped and strongly-typed// versus //unscoped//). ===== Basics ===== Underlying type is ''int'': <code> enum struct|class Color { red, green, blue }; ... Color::red Color::green </code> Possible definitions: <code> Warning w1 = Warning::red; enum Warning w2 = Warning::green; enum class Warning w3 = Warning::blue; // no </code> ===== Treating scoped enums like ints ===== Stack Overflow explanation [[https://stackoverflow.com/questions/8357240/how-to-automatically-convert-strongly-typed-enum-into-int|here]]. See source for ''ios_base.h'' [[https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/ios_base.h|here]]. c_enums.txt Last modified: 2018/02/04 12:15by rpjday