fork download
  1. #include<iostream>
  2. #include<functional>
  3.  
  4. using namespace std;
  5. class student
  6. {
  7. public:
  8. int fun1(int m) {
  9. return 2*m;
  10. }
  11. };
  12.  
  13. int main()
  14. {
  15. student s;
  16. int l=5;
  17. //int my=s.wrapper(&student::fun1(l));
  18. int my=mem_fn(&student::fun1)(&s,l);
  19. cout<<my<<endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
10