December 2020
Intermediate to advanced
544 pages
12h 45m
English
C++ has the ability to evaluate expressions at compile time, meaning that values are already calculated when the program executes. Even though metaprogramming has been possible since C++98, it was initially very complicated due to its complex template-based syntax. With the introduction of constexpr, if constexpr, and recently, C++ concepts, metaprogramming has become much more similar to writing regular code.
This chapter will give you a brief introduction to compile-time expression evaluations in C++ and how they can be used for optimization.
We will cover the following topics: