fork download
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4. using namespace placeholders;
  5.  
  6. class D {
  7. public:
  8. void foo ( int a ) {
  9. cout << "D" << endl;
  10. }
  11.  
  12. int data;
  13. };
  14.  
  15.  
  16. int main ( void )
  17. {
  18. D d;
  19.  
  20. auto f = std::bind( &D::foo, _1, _2 );
  21. f(&d, 5);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
D