Templates made easy with C++20: how constexpr/consteval, fold expressions, and concepts change how we write code
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.
After demonstrating how to use and write concepts, we will look at some examples of production UI 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.
Roth Michaels is a Principal Software Engineer at iZotope/Soundwide, an industry leader in real-time audio software for music production and broadcast/film post-production. In his current role on the Audio Research Team at iZotope's parent company, Soundwide, he is focused on developing new fast prototyping frameworks. When he joined iZotope, Roth was the lead library designer of a new internal cross-platform "Glass", part of which is now available as open-source. More recently in his former role as Mix/Master Software Architect, Roth helped develop the reference implementation to move iZotope's products to subscription and led the team that launched the company’s first SaaS offering for music producers. Roth studied music composition at Brandeis University and continued his studies in the Dartmouth Digital Musics program. Roth began his career in software development writing software for his own compositions, and the works of other composers and artists, and teaching MaxMSP to composers and musicians; both private instruction and designing university courses. Before joining iZotope, he was working as a consultant for small startups working on mobile applications specializing in location services and Bluetooth.