1 post tagged #functional.
#functional
std::function and std::copyable_function are both type-erased callable wrappers and neither recognises the other. Converting between them does not unwrap and rewrap the lambda inside; it wraps the whole previous wrapper. Round-trip in a loop and every call walks a chain of indirections. In this run, 200 round trips made the same calls several hundred times slower.
// We use Google Analytics to understand which posts get traction and how the wro.cpp community grows. Anonymised, no ads, and you can decline -- the site works either way.