CppCon 2019 has ended
Friday, September 20 • 09:00 - 10:00
Higher-order functions in Modern C++: existing techniques and `function_ref`

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

Most modern languages treat functions as first-class citizens, and Modern C++ is no different. The introduction of lambda expressions and utilities such as `std::function` enable countless functional programming patterns that can increase the flexibility and safety of APIs, and help reduce code repetition on the implementation side.

In this talk we're going to see examples of how higher-order functions can be used in practice to increase the quality of production code and the productivity of developers, focusing on pragmatic use cases that can be integrated in an existing codebase instead of fully functional patterns.

A new abstraction proposed to the Standard Library for C++20, `function_ref`, will also be covered and compared to existing techniques for the implementation of higher-order functions.

`function_ref` is a lightweight wrapper over any `Callable` with a given signature that is easy for the compiler to optimize and inline. This presentation will go over the specification and implementation of `function_ref`, covering potential future extensions and possible pitfalls.

avatar for Vittorio Romeo

Vittorio Romeo

Software Engineer, Bloomberg
Vittorio Romeo (B.Sc. Computer Science) has been a Software Engineer at Bloomberg for more than 3 years, working on mission-critical company C++ infrastructure and providing Modern C++ training to hundreds of fellow employees.He began programming around the age of 8 and quickly became... Read More →

Friday September 20, 2019 09:00 - 10:00 MDT
Crest 4/5