Constants are great. Types are great. Constants of a specific type are really great. This is why enum classes are just fantastic. Last year, we talked about why we should avoid using boolean function parameters. One of the solutions proposed uses strong types, in particular using enums instead of raw booleans. This time, let’s see how enums and the related support evolved during the course of the years. Unscoped enumerations Enumerations are part of the original C++ language, in fact, they were taken over from C. Enumerations are distinct types with a restricted range of values. The range of values is restricted to some explicitly named constants. Let’s quickly have a look at an enum. 1 enum Color { red, green, blue }; After having read this very small example, it’s worth noticing two things: The enum itself is a singular noun, even though it enumerates multiple values. We use such conventions because we keep in mind that it will be always used with one value. If you take a Color function parameter, one colour…