#include #include #include #include #include "date.h" #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; const date crash(date::october, 29, 1929); //stock market const istream_iterator_date it = find(istream_iterator_date(ifs), end, crash); if (it == end) { cout << "The file does not contain " << crash << ".\n"; } else { cout << "The file contains " << crash << ".\n"; } return EXIT_SUCCESS; }