//* Max overloaded functions versus function template *

char maximum(char a, char b) { if (a>=b) return(a); else return(b); } int maximum(int a, int b) { if (a>=b) return(a); else return(b); } double maximum(double a, double b) { if (a>=b) return(a); else return(b); } // Or one function which does all of the above and more... template <typename T> T maximum(T a, T b) { if (a>=b) return(a); else return(b); } // the template function will do the task for any data type // including your future defined on your own data types // The compiler will only have to know how to perform = on them