C++Now 2021 has ended
Back To Schedule
Friday, May 7 • 9:00am - 10:30am
Taking Template Classes One Step Further with Opaques Types and Generic NTTPs

Log in to save this to your schedule, view media, leave feedback and see who's attending!

With the new features brought by C++20 has come a time to revise the way interfaces are designed, starting with the needs of users. In this talk, we explore how opaque types and C++20's generic NTTPs can be leveraged to maximize the expressivity of template classes.

In the first part, we will discuss how opaque types and type erasure can help reduce template parameters bloat when no compile-time programming technique can help improve performance.

In the second part, we will see how C++20's template contexts can act as Embedded Domain Programming Languages (EDSLs) mini-compilers thanks to generic NTTP's and how Expression Template (ET) can be taken one step further when injected as template parameters.

We will demonstrate that generic NTTP can be leveraged to produce at the same time terser interfaces and more generic customization points. We will illustrate these approaches on the canonical problem of generic multidimensional arrays that have withstood standardization for decades and which is finally about to surrender. We will show in particular how the new metaprogramming techniques allowed by C++20 can be used to go further on the path opened by mdspan.

Finally, we will discuss how making C++ kind-generic would constitute the next big step for the core language regarding this topic, and how it could unleash the craziest ideas in terms of generative programming.

avatar for Joel Falcou

Joel Falcou

assistant professor, LRI - Université paris 11
Joel Falcou is an assistant professor at the University Paris-Sud andresearcher at the Laboratoire de Recherche d'Informatique in Orsay, France. His researches focus on studying generative programming idioms and techniques to design tools for parallel software development. The two... Read More →
avatar for Vincent Reverdy

Vincent Reverdy

Researcher, CNRS
Vincent Reverdy is a Full Researcher in Computer Science and Astrophysics at French Center for Scientific Research (CRNS) and located at the Annecy Laboratory for Particle Physics (LAPP) in the French Alps. He also is a member of the French delegation to the C++ Standards Committee... Read More →

Friday May 7, 2021 9:00am - 10:30am MDT