fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class C
  5. {
  6. public:
  7. template<typename T>
  8. void f(T t);
  9. };
  10.  
  11. template<typename T>
  12. void C::f(T t)
  13. {
  14. cout << t << endl;
  15. }
  16.  
  17. template<>
  18. void C::f<int>(int t)
  19. {
  20. cout << "(int specialization) " << t << endl;
  21. }
  22.  
  23. int main()
  24. {
  25. C c;
  26. c.f(0);
  27. return 0;
  28. }
Success #stdin #stdout 0s 2852KB
stdin
stdout
(int specialization) 0