~/talk

C++ Zero Overhead Pass by Value Through Invocable C++ Abstractions

Talkat C++Now 2024 · 2024-04-29..05-03· [compilers-and-language-design]
links:none on file
slides:none on file

Library type erasure like std::function currently forces an extra copy/move when a non‑trivial object is passed by value; the claim is that this can be avoided. The technique rewrites the callee pointer types at runtime using a reinterpret_cast thunk that replaces non‑trivial value parameters with rvalue references (relying on the Itanium ABI calling convention), adds a constrained constructor and a match_signature overload resolution trick to pick the correct call operator, and yields a function_ref style abstraction that eliminates the extra copy/move on tested platforms (works but is formally undefined behavior).

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 2:30Passing values through abstractions
  3. 9:12Implementing function_ref
  4. 12:05Motivation and performance
  5. 17:50Constructors for free functions
  6. 18:12Member functions support
  7. 22:45Function objects and overloads
  8. 34:26Q&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.