Meetup session May 24 20212
Six ways for implementing max: a walk through API design, dangling references and C++20 constraints
Abstract:
API design in C++ is harder than in other languages, as the lifetime of the arguments and return value shall be considered carefully. While it gives programmers the full power in expressing their intent, it raises all sorts of concerns that should be considered. In this talk we would analyze a very simple function: max, we would see that selecting the proper API is not as simple as it may seem and discuss several alternatives. The discussion would take us through lvalue, rvalue and forwarding references, the rules of moving from a local, variadic templates design, the differences between returning auto and decltype(auto) and C++20 constraints.
Bio:
Amir Kirsh is a C++ lecturer at the Academic College of Tel-Aviv-Yaffo and Dev Advocate at Incredibuild. He is also the Co-organizer of Core C++ conference and a member of the Israeli ISO C++ NB.
Meeting event: https://www.meetup.com/San-Diego-CPP/events/285561768/
Recording: