#include #include #include "date.h" using namespace std; template void f(T t1 = T()) //call default constructor if actual argument missing { //t1, t2, and *p will be initialized for every data type T T t2 = T(); //call default constructor const T *const p = new T(); //call default constructor //t3 and *q will be uninitialized if T is built-in, pointer, enumeration T t3; //might not call any constructor at all const T *const q = new T; //might not call any constructor at all cout << t1 << "\t" << t2 << "\t" << *p << "\t" << T() << "\t" << t3 << "\t" << *q << "\n"; delete q; delete p; } enum stooge {moe, larry, curly}; int main() { int i = 10; f(date(date::december, 31, 2014)); f(i); f(&i); f(curly); return EXIT_SUCCESS; }