Overloading: The Bane of All Higher-Order Functions - Simon Brand [ CppCon 2018 ]

Overloading: The Bane of All Higher-Order Functions - Simon Brand [ CppCon 2018 ]

4.239 Lượt nghe
Overloading: The Bane of All Higher-Order Functions - Simon Brand [ CppCon 2018 ]
http://CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2018 — 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. — Simon Brand, Microsoft C++ Developer Advocate 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 to various programming standards bodies. Outside of programming, he enjoys experimental films, homebrewing, and board games. — Videos Filmed & Edited by Bash Films: http://www.BashFilms.com — Optimized And Managed by Digital Medium Ltd - events.digital-medium.co.uk [email protected] *-----* Register Now For CppCon 2022: https://cppcon.org/registration/ *-----*