Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| c_enums [2018/02/04 10:16] – [Overview] rpjday | c_enums [2018/02/04 12:15] (current) – [Basics] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | C++11 extensions to enums -- enum classes versus original " | + | C++11 extensions to enums -- enum classes versus original " |
| ===== Basics ===== | ===== Basics ===== | ||
| + | |||
| + | Underlying type is '' | ||
| < | < | ||
| - | enum class Color { red, green, blue }; | + | enum struct|class Color { red, green, blue }; |
| ... | ... | ||
| Color::red | Color::red | ||
| Line 19: | Line 21: | ||
| enum class Warning w3 = Warning:: | enum class Warning w3 = Warning:: | ||
| </ | </ | ||
| + | |||
| + | ===== Treating scoped enums like ints ===== | ||
| + | |||
| + | Stack Overflow explanation [[https:// | ||
| + | |||
| + | See source for '' | ||