fork(2) download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. using namespace std;
  5.  
  6. class X {
  7. public:
  8. template<typename T>
  9. void f(T t) {
  10. cout << t << endl;
  11. }
  12. };
  13.  
  14. int main() {
  15. X xx;
  16. xx.f(5);
  17. function<void(X,int)> ff(&X::f<int>);
  18. ff(xx, 5);
  19. return 0;
  20. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
5
5