#include #include using namespace std; template T Min(T a, T b) { T rv = b; if (a < b) { rv = a; } return rv; } int main() { cout << Min(1,2) << endl; cout << Min(2,1) << endl; cout << Min('a', 'b') << endl; cout << Min('b', 'a') << endl; cout << Min("Hello", "World") << endl; cout << Min("World","Hello") << endl; vector a{1,2,3}, b{1,2,4}; vector c; c = Min(a,b); for(auto x: c) { cout << x << " " ; } cout << endl; c = Min(b,a); for(auto x: c) { cout << x << " " ; } cout << endl; return 0; }