Loading…
This event has ended. Visit the official site or create your own event on Sched.
Monday, September 25 • 5:20pm - 5:50pm
folly::Function: A Non-copyable Alternative to std::function

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

Feedback form is now closed.
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>).

Speakers
avatar for Sven Over

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.


Monday September 25, 2017 5:20pm - 5:50pm PDT
Manchester (407) Meydenbauer Center