Back to Browse

CppCon 2017: Sven Over “folly::Function: A Non-copyable Alternative to std::function”

6.1K views
Oct 11, 2017
31:18

http://CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2017 — We have often found it limiting that std::function cannot store callable objects if they are not copyable, so we developed and open-sourced folly::Function, a function wrapper that can store move-only callable objects. This presentation outlines the design decisions behind folly::Function and illustrates their consequences and our experiences after 18 months of wide production use at Facebook. We find folly::Function is more appropriate than std::function for typical use cases, such as storing callback functions and submitting tasks for asynchronous execution. Other features of folly::Function include that it is noexcept-movable, and it avoids some known issues regarding const-correctness in std::function, which allows to invoke non-const operations on a const reference. Instead, folly::Function lets you declare whether a callable may or may not mutate its state (e.g. folly::Function<void() const>). — Sven Over: Software Engineer, Facebook Sven completed a PhD in astro-particle physics before he turned full time software engineer. He worked on C++ data services at Last.fm, and is now at Facebook London. — Videos Filmed & Edited by Bash Films: http://www.BashFilms.com Work at Hudson River Trading (HRT): https://tinyurl.com/safxfctf --- Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Download

1 formats

Video Formats

360pmp445.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

CppCon 2017: Sven Over “folly::Function: A Non-copyable Alternative to std::function” | NatokHD