fork(2) download
  1. #include <iostream>
  2. #include <functional>
  3. #include <typeinfo>
  4.  
  5. struct Ex
  6. {
  7. void f(); //member function
  8. std::function<void()> g; //member std::function
  9. void (*h)(); //member pointer to function
  10. };
  11.  
  12. int main()
  13. {
  14. //no instance of Ex exists
  15. auto my_f = &Ex::f;
  16. std::cout << typeid(my_f).name() << std::endl;
  17. }
  18.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
M2ExFvvE