fork(2) download
  1. #include <memory>
  2.  
  3. struct A
  4. {
  5. void foo(const int& i) { }
  6. };
  7.  
  8. template <typename F, class ...Args>
  9. void a_caller(A& a, F &&f, Args&& ...args)
  10. {
  11. (a.*f)(std::forward<Args>(args)...);
  12. }
  13.  
  14. int main()
  15. {
  16. int i = 42;
  17. A a;
  18.  
  19. a_caller(a, &A::foo, i);
  20. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty