Does C++11 provide delegates?
If not, what is the best (most efficient) way to do something similar in C++? Boost.Signals? FastDelegate? Something else?
Though std::function
works nicely, I would like to point out this nice piece of delegate code, written here (including example usage!). Following the references and answers there you can read all about how this Delegate
class is constructed and why it may be faster than std::function
.
Note also my question here for a problem I encountered with it on VS 2015.