#include #include "MinT.h" #include #include #include using namespace std; class FooT { public: FooT(int data) { a = data; } bool operator <(const FooT & other) const { return a < other.a; } int Getter() const { return a; } private: int a; }; ostream & operator <<(ostream & s, const FooT & data) { s << data.Getter(); return s; } int main() { string a{"hello"}; string b{"world"}; cout << " The min of 2 and 3 is " << Min(2,3) << endl; cout << " The min of hello and world is " << Min(a,b) << endl; FooT one{1}, two{2}; cout << " The min of " << one << " and " << two <<" is " << Min(one,two) << endl; cout << " The min of " << one << " and " << two <<" is " << Min(two,one) << endl; float x{1.14f}; int j{2}; cout << "the min of " << x << " and " << j << " is " << Min(x,j) << endl; vector myWords{a,b}; vector myNumbers; for(size_t i =0; i < 10; ++i) { FooT tmp{rand() % 100}; myNumbers.push_back(tmp); } sort(begin(myNumbers), end(myNumbers)); for(size_t i = 0; i < myNumbers.size(); ++i) { cout << myNumbers[i] << " "; } cout << endl; return 0; }