fork(1) download
  1. #include <iostream>
  2.  
  3. template<class T>
  4. int test(T y);
  5.  
  6.  
  7. int main()
  8. {
  9. std::cout << test<int>(0) << "\n";
  10. }
  11.  
  12. template<class T>
  13. int test(T y)
  14. {
  15. return 0;
  16. }
  17.  
  18. // POI for test<int>() should be right here
  19.  
  20. template<>
  21. int test(int y)
  22. {
  23. return 2;
  24. }
Compilation error #stdin compilation error #stdout 0s 3340KB
stdin
Standard input is empty
compilation info
prog.cpp:21:15: error: specialization of ‘int test(T) [with T = int]’ after instantiation
 int test(int y) 
               ^
stdout
Standard output is empty