Instances of std::function can store, copy, and invoke any CopyConstructible Callable target -- functions (via pointers thereto), lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and pointers to data members.
Class template std::function is a general-purpose polymorphic function wrapper.
Делегат, т.е. std::function, не умеет захватывать указатели на методы.
struct MyStruct
{
void Test(int){}
};
std::function<void(MyStruct&, int)> f = &MyStruct::Test;
template<typename TSender, typename TEventArgs.
using EventHandler = std::function<void(TSender&, TEventArgs)>;