function_ref
summary
A proposal called function_ref provides a constrained callable type that behaves like a non-owning lightweight reference to any callable matching a signature so higher order functions accept stateful lambdas without owning or heap overhead. It compares performance to function pointers and templates showing small runtime cost unlike std::function and avoids template bloat. The minimal implementation stores a void pointer to the target and a function pointer to a erased call wrapper so callers must guarantee the referent’s lifetime.
AI-written summary · about
chapters (4)
related talks
01h 10mstd::function: a deep dive behind the curtain
01h 10mstd::function: a deep dive behind the curtain
59mTaming Lambdas' uniqueness
57mstd function, past, present, future
01h 09mFunctional Programming in C++
08mReturn Values Take A Closure Walk
48mWhat is a static function but isn't a static function
06mmy favorite C++ feature
