From Jason Turner
Watch on YouTube

Summary

In this episode, Jason continues his series on modernizing code by migrating from C++17 to C++20. He focuses on C++20's enhanced constexpr capabilities, which now support most standard library containers including std::vector. He demonstrates how to make custom data structures constexpr-compatible, replaces manual comparison operators with the spaceship operator (operator<=>), implements a consteval user-defined literal for rational numbers, and uses concepts to improve code safety. Through these improvements, he transforms a library with runtime components into a compile-time, header-only library with stronger guarantees.

Resources

Tags