std function, past, present, future
summary
A concise, concrete itinerary: implements an Observer with C-style function pointers, measures std::function internals (type‑erasure metadata plus SSO buffer) and reports typical sizes as about five pointer widths and observed worst cases up to ten pointer widths, compares alternatives, and publishes code at OptimumCpp/short_function. Proposes a memory‑lean short function (mono_state-only, no dynamic allocation, size ≈ void) and a customizable line function* with user-controlled SSO, offers a CRTP function_base and template vars to eliminate UB and reduce allocations.
AI-written summary · about
chapters (7)
- 0:00Start
- 2:25Examples of free function pointers
- 9:41Consequences of variadic template proposal
- 37:06Exact signature in generic functional libraries
- 42:19function CRTP base
- 46:03Core language improvements
- 50:19Summery of proposed tools
related talks
01h 05mIs std::function really the best we can do?
01h 09mFunctional Programming in C++
01h 06mBack to Basics: Functions in C++
01h 04mFunctional C++ for Fun and Profit
01h 01mCalling Functions: A Tutorial
01h 01mFreestanding C++ - Past, Present, and Future
59mFunctional Programming: data
48mBack to Basics: Cpp Value Semantics
