fork download
  1.  
  2. template<typename T>
  3. void f(T a, T b) {}
  4.  
  5. float get_value() //consider this too!
  6. {
  7. return 1.0;
  8. }
  9. int main()
  10. {
  11. f(get_value(), 1); //compilation error
  12. f(get_value(), 1.0); //compilation error
  13. f(get_value(), 1.0f); //okay
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11: error: no matching function for call to ‘f(float, int)’
prog.cpp:12: error: no matching function for call to ‘f(float, double)’
stdout

Standard output is empty