fork download
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. void f (T t) {
  5. std::cout << "generic\n";
  6. }
  7.  
  8. void f (int i) {
  9. std::cout << "int\n";
  10. }
  11.  
  12. void f (float f) {
  13. std::cout << "float\n";
  14. }
  15.  
  16. int main() {
  17. f(5);
  18. f(5.f);
  19. f(5.);
  20. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
int
float
generic