#include #include #include #include //for pair and make_pair #include "date.h" using namespace std; //T1 and T2 must be puttable (i.e., able to be output with <<). template inline void f(const pair& p) { cout << "(" << p.first << ", " << p.second << ")\n"; } int main() { pair A(3.0, 4.0); cout << "Point A is (" << A.first << ", " << A.second << ").\n"; pair signer("John", "Hancock"); cout << "The signer is " << signer.first << " " << signer.second << ".\n"; f(A); f(pair(3.0, 4.0)); f(make_pair(3.0, 4.0)); //construct a pair f(make_pair( "Independence Day" , date(date::july, 4, 1776))); f(make_pair(string("Independence Day"), date(date::july, 4, 1776))); return EXIT_SUCCESS; }