CppCon 2018 has ended
Tuesday, September 25 • 15:15 - 15:45
Overloading: The Bane of All Higher-Order Functions

Sign up or log in to save this to your schedule and see who's attending!

Support for functional programming has been consistently growing in C++. Lambdas, new algorithms, variant visitation and std::apply are just a few of the many additions which make use of the paradigm more natural, expressive and powerful. Unfortunately, passing overloaded functions or function templates to higher-order functions is not as simple as it sounds, which forces users to adopt various unsatisfactory workarounds. This talk will discuss a few solutions, show how C++ still has a way to go in providing language support, and examine some existing standards proposals which could help.

Techniques discussed will include wrapping up overload sets in lambdas; maintaining noexcept specifications, return types, and brevity; global function objects; and avoiding subtle One Definition Rule (ODR) violations.

avatar for Simon Brand

Simon Brand

C++ Developer Advocate, Microsoft
Simon is a C++ Developer Advocate at Microsoft. He turns into a metaprogramming fiend every full moon, when he can be found bringing compilers to their knees with template errors and debating undefined behaviour online. He co-organises the Edinburgh C++ user group and contributes... Read More →

Tuesday September 25, 2018 15:15 - 15:45
Copper Mountain Theater (2nd Floor)

Attendees (197)