#include <iostream>
#include <functional>

struct A
{
   void f() { std::cout << "A::f() called" << std::endl; }
};

int main() 
{
   std::function<void(A*)> fun(&A::f);
   A a;
   fun(&a);
}