#include <iostream> // maximum of two values of any type: template<typename T> T max (T a, T b) { std::cout << "max<T>()\n"; return b < a ? a : b; } // maximum of two int values: int max(int a, int b) { std::cout << "max(int,int) \n"; return b < a ? a : b; } // maximum of three values of any type: template<typename T> T max (T a, T b, T c) { return max (max(a,b), c); } struct S {}; S max(S, S) { std::cout << "max(S,S)\n"; return {}; } int main() { ::max(47, 11, 33); ::max(S{}, S{}, S{}); }