#include #include #include #include //for copy and fill_n #include //for ostream_iterator #include "date.h" using namespace std; int main() { const date a[] = { date(date::july, 4, 1776), date(date::october, 29, 1929), date(date::december, 7, 1941), date(date::july, 20, 1969), date(date::september, 11, 2001) }; const size_t n = sizeof a / sizeof a[0]; vector v(a, a + n); for (vector::const_iterator it = v.begin(); it != v.end(); ++it) { cout << *it << "\n"; } cout << "\n"; ostream_iterator os(cout, "\n"); for (vector::const_iterator it = v.begin(); it != v.end(); ++it, ++os) { *os = *it; } cout << "\n"; copy(v.begin(), v.end(), os); cout << "\n"; fill_n(ostream_iterator(cout), 80, '*'); cout << "\n"; return EXIT_SUCCESS; }