fork(3) download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. struct Foo
  5. {
  6. void Bar()
  7. {
  8. std::cout << "Bar called!";
  9. }
  10. };
  11.  
  12. int main() {
  13. using std::placeholders::_1;
  14. std::function< void( Foo ) > func = std::bind( &Foo::Bar, _1 );
  15.  
  16. Foo f;
  17. func( f );
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Bar called!