fork(1) download
  1. #include <limits>
  2. #include <iostream>
  3.  
  4. template <typename T>
  5. extern auto foo = std::numeric_limits<T>::max();
  6.  
  7. int main() {
  8. std::cout << foo<float> << std::endl; // prints 3.40282e+38
  9. foo<float> = 42.0;
  10. std::cout << foo<float> << std::endl; // prints 42
  11. return 0;
  12. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
3.40282e+38
42