Monthly Archives: March 2024

Implementing a std::function<>-like wrapper in C++, part 2: generalizing the return type and arguments

Introduction Previously, we’ve seen a way to implement our own version of std::move_only_function<>. The implementation we ended up with is as follows: This works for any movable function, for example: Unfortunately, it is restricted to the function prototype int fn(int, … Continue reading

Posted in Programming | Tagged | Leave a comment