Template metaprogramming allows us to write C++ code that is executed during compile-time as opposed to the usual execution time. The constexpr keyword, which was added in C++11, allows us to use even more compile-time code, and consteval keyword from C++20 aims to give us greater control over the way the code is evaluated.
One of the problems with compile-time programming is that there is no easy way to test it. While unit testing frameworks for execution time code are abundant (as we just saw), there are not that many resources regarding compile-time programming. Part of this may stem from the fact that compile-time programming is still considered complicated and only aimed at experts.
Just because something isn't easy doesn't mean it is impossible, though. Just like execution time tests rely on assertions being checked during runtime, you can check your compile-time code for correct behavior using static_assert, which was...