From Jason Turner
Watch on YouTube

Summary

Jason comprehensively explores all possible techniques to force C++ compilers to perform calculations at compile time. He explains that simply marking a function or variable as constexpr doesn't guarantee compile-time evaluation, then walks through alternatives including static constexpr, constinit, consteval, non-type template parameters, and wrapper functions like Andreas Fertig's as_constant. The episode concludes with Jason introducing his own consteval_invoke utility for forcing compile-time evaluation.

Resources

Tags