As C++11 took shape, there was growing recognition that another area ripe for vocabularization was that of the so-called algebraic data types. Algebraic types arise naturally in the functional-programming paradigm. The essential idea is to think about the domain of a type--that is, the set of all possible values of that type. To keep things simple, you might want to think about C++ enum types, because it's easy to talk about the number of different values that an object of enum type might assume at one time or another:
enum class Color {
RED = 1,
BLACK = 2,
};
enum class Size {
SMALL = 1,
MEDIUM = 2,
LARGE = 3,
};
Given the types Color and Size, can you create a data type whose instances might assume any of 2 × 3 = 6 values? Yes; this type represents "one of each" of Color and Size, and is called...