fork(2) download
  1. #include <iostream>
  2. #include <limits>
  3.  
  4. // C2589 when compiling with specialization, fine when compiling without
  5. template<typename T>
  6. void foo(T value = std::numeric_limits<T>::infinity())
  7. {
  8. }
  9.  
  10. // this specialization causes compiler error C2589 above
  11. template<>
  12. void foo<float>(float value)
  13. {
  14. }
  15.  
  16. int main()
  17. {
  18. foo<float>();
  19. return 0;
  20. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty