Higher-Order Functions and function_ref

By Vittorio Romeo

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 in the implementation.

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. A new abstraction I proposed to the Standard Library for C++20, function_ref, will also be covered and compared to other techniques for the implementation of higher-order functions. function_ref aims to be a lightweight wrapper over any Callable with a given signature that is easy for the compiler to optimize and inline.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.