In this recipe, we will refer to and simplify the code written in previous recipes. Before continuing with the recipe, you should take a moment to go back and review the code we have written in those recipes, which is as follows:
- The compute() overloads for integral and non-integral types from the Conditionally compiling classes and functions with enable_if recipe.
- User-defined 8-, 16-, and 32-bit binary literals from the Creating raw user-defined literals recipe of Chapter 2, Working with Numbers and Strings.
These implementations have several issues:
- They are hard to read. There is a lot of focus on the template declaration, yet the body of the functions are very simple, for instance. The biggest problem, though, is that ...