#include <iostream>
//...
// 1
inline int const& max(int const& a, int const& b)
{
return a < b ? b : a;
}
// 2
template<typename T>
inline T const& max (T const& a, T const& b)
{
return a < b ? b : a;
}
//...
int main()
{
//...
std::cout << ::max('a', 42.7) << std::endl; //3
//...
return 0;
}
Login in to like
Login in to comment