fork(16) download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. struct A
  5. {
  6. void f() { std::cout << "A::f() called" << std::endl; }
  7. };
  8.  
  9. int main()
  10. {
  11. std::function<void(A*)> fun(&A::f);
  12. A a;
  13. fun(&a);
  14. }
Success #stdin #stdout 0s 2828KB
stdin
Standard input is empty
stdout
A::f() called