Summary
In this chapter, you have learned how to use metaprogramming to generate functions and values at compile time instead of runtime. You also discovered how to do this in a modern C++ way by using templates, the constexpr
, static_assert()
, and if constexpr
, type traits, and concepts. Moreover, with constant string hashing, you saw how to use compile-time evaluation in a practical context.
In the next chapter, you will learn how to further expand your C++ toolbox so that you can create libraries by constructing hidden proxy objects.