Chapter 2 Enumerations

Like Rust, C++ has enums. Unlike Rust, their enums are much less powerful. C++‘s enumeration comes in two flavors: the plain, C-compatible enum, and the enum class. Generally, you should always use an enum class, but you should also learn about the plain enum in order to read others’ code.