fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T, typename U>
  5. auto max(T x, U y) -> decltype(x>y ? x : y)
  6. {
  7. return x>y ? x : y;
  8. }
  9.  
  10. int main()
  11. {
  12. cout<<max(17.9,17)<<"\n";
  13. cout<<max(17,17.9)<<"\n";
  14. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
17.9
17.9