C++ templates are a powerful tool for compile-time programming, generic programming, and metaprogramming. Historically many of these techniques have been considered advanced techniques or even arcane-magic by many C++ developers. Complex error messages and concepts like SFINAE being hard to teach can leave use of C++ templates out of reach—if you don’t know what SFINAE, come to this talk and find out what it is and why you might not need to use it anymore.
With C++17/20, constexpr, consteval, concepts, and fold expressions can change the way we teach a write C++ for compile-time programming, generic programming, and metaprogramming. This talk will cover these new C++ features and show how they change the templated C++ one would have written in the past.
To demonstrate how to use and write concepts, we will look at some examples based on production GUI and DSP library code that can be simplified to be easier to write and understand by adopting C++20 concepts combined with constexpr/consteval and fold expressions.
See lessons learned by teams that have moved to C++20 and started using concepts, and how your teams could benefit from these features in the latest C++ standards.