Writing a general minimum function, Two questions came to my mind. The code works fine with any input type and different argument number:
namespace xyz { te
After the answer and worth comments I did it as below:
template auto min(const T1 &a, const T2 &b) -> typename std::common_type::type { return a < b ? a : b; } template auto min(const T1 &a, const T2 &b, const Args& ... args) -> typename std::common_type::type { return min(min(a, b), args...); }