~/talk

“folly::Function: A Non-copyable Alternative to std::function”

Talkat CppCon 2017 · 2017-09-24..09-29· [c-and-cpp, software-architecture]
name:Sven Over
links:none on file
slides:none on file

A replacement for std::function that stores move-only callable objects and is deliberately non-copyable, folly::Function is implemented like std::function but sized at 64 bytes with 48 bytes for in-place storage, uses two function pointers for invoke and management, and is noexcept-movable so it works with STL containers and avoids copy-workarounds. Benchmarks show slightly faster invokes (~2.0 ns vs 2.3 ns) and create+invoke (2.8 ns vs 3.0 ns). It enforces const correctness, migrated easily at Facebook after 18 months of production use.

AI-written summary · about

  1. 0:00Introduction to callable types
  2. 1:54Need for function wrappers
  3. 4:35Standard function overview
  4. 6:10Facebook use cases
  5. 10:09Limitations of std::function
  6. 14:25Introducing folly::Function
  7. 17:19Implementation details
  8. 21:11Migration experience
  9. 23:42Performance benchmarks
  10. 25:41Q&A and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.