#include #include #include "date.h" using namespace std; template void f(const T& t) { T *const p = reinterpret_cast(new char[sizeof (T)]); new(p) T(t); //call the copy constructor cout << *p << "\n"; p->~T(); //call the destructor delete[] reinterpret_cast(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; }