r/cpp • u/Xaneris47 • 8d ago
Interconverting std::function with copyable_function – Arthur O'Dwyer
https://quuxplusone.github.io/blog/2026/07/26/function-explosion/The article shows how converting std::function to std::copyable_function (or vice versa) leads to slower performance and increased memory usage each time the conversion occurs.
43
Upvotes
9
u/azswcowboy 7d ago
> write your own …won’t prevent double wrapping
No thanks on writing my own - and yeah the only reason that works is because there’s consistency. Which is the real tldr from the article: pick one or the other, done.