language: C++11 (gcc-4.7.2)
date: 264 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
using namespace std;
 
template <typename T, typename U>
auto max(T x, U y) -> decltype(x>y ? x : y)
{
    return x>y ? x : y;
}
 
int main()
{
    cout<<max(17.9,17)<<"\n";
    cout<<max(17,17.9)<<"\n";
}