#include #include #include #include #include "date.h" using namespace std; template T min(T a, T b); //function declaration const char *min(const char *a, const char *b); const wchar_t *min(const wchar_t *a, const wchar_t *b); int main() { date today; date tomorrow = today + 1; cout << ::min(10, 20) << "\n" //calls line 30 << ::min(3.14, 2.71) << "\n" //calls line 30 << ::min(today, tomorrow) << "\n" //calls line 30 << ::min("hello", "goodbye") << endl; //calls line 36 wcout << ::min(L"hello", L"goodbye") << L"\n"; //calls line 42 return EXIT_SUCCESS; } template T min(T a, T b) //function definition { cout << "::min\n"; //to see which function is called return b < a ? b : a; } const char *min(const char *a, const char *b) { cout << "::min(const char *)\n"; return strcmp(b, a) < 0 ? b : a; } const wchar_t *min(const wchar_t *a, const wchar_t *b) { cout << "::min(const wchar_t *)\n"; return wcscmp(b, a) < 0 ? b : a; }