To meet this requirement, we need to provide an implementation for several types, operators, and functions:
- An enumeration of supported temperature scales called scale.
- A class template to represent a temperature value, parameterized with the scale, called quantity.
- Comparison operators ==, !=, <, >, <=, and >= that compare two quantities of the same time.
- Arithmetic operators + and - that add and subtract values of the same quantity type. Additionally, we could implement member operators += and -+.
- A function template to convert temperatures from one scale to another, called temperature_cast. This function does not perform the conversion itself but uses type traits to do that.
- Literal operators ...