fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Foo
  6. {
  7. public:
  8. template<typename T>
  9. void action(T t);
  10. };
  11.  
  12. template<typename T>
  13. void Foo::action(T t)
  14. {
  15. std::cout << "normal" << std::endl;
  16. }
  17.  
  18. template<>
  19. void Foo::action<int>(int t)
  20. {
  21. std::cout << "int" << std::endl;
  22. }
  23.  
  24. int main()
  25. {
  26. Foo foo;
  27.  
  28. foo.action(1.0);
  29. foo.action(1);
  30. return 0;
  31. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
normal
int