fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A { void test() { cout<<"A"<<endl; } };
  5. struct B { void test() { cout<<"B"<<endl; } };
  6.  
  7. template<typename T>
  8. void test(T & x)
  9. {
  10. x.test();
  11. }
  12.  
  13.  
  14. int main()
  15. {
  16. A a;
  17. test(a);
  18.  
  19. B b;
  20. test(b);
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
A
B