Summary: Compile-Time Programming

A summary of what we discussed in the “Compile-Time Programming” chapter.

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.

Get hands-on with 1400+ tech skills courses.