#include #include #include #include "istream_iterator_date.h" using namespace std; int main(int argc, char **argv) { ifstream ifs("infile"); if (!ifs) { cerr << argv[0] << ": couldn't open infile\n"; return EXIT_FAILURE; } const istream_iterator_date end; istream_iterator_date it1(ifs); istream_iterator_date it2 = it1; if (it2 != end) { date d = *++it2; } for (; it1 != end; ++it1) { cout << *it1 << "\n"; } return EXIT_SUCCESS; }