#include #include #include using namespace std; /* int min(int a, int b) { int small{b}; if (a < b) { small = a; } return small; } */ template T myMin(T a, T b) { T small{b}; if (a < b) { small = a; } return small; } int main() { vector x {5,2,3}; vector y {3,2,1}; vector z; cout << "The smallest of 3, 5 is " << myMin(3,5) << endl; cout << "The smallest of 5, 3 is " << myMin(5,3) << endl; cout << "The smallest of hello, world = " << myMin("hello","world") << endl; cout << "The smallest of world, hello = " << myMin("world","hello") << endl; z = myMin(x,y); for(auto element: z) { cout << element << " "; } cout << endl; cout << myMin(3.14f,4)<< endl ; return 0; }