#include <iostream>
#include <list>
#include <string>
using namespace std;
int main()
{
list<string> the_list(
(istream_iterator<string>(cin)),
istream_iterator<string>()
);
}
According to Jossutis, the start iterator will equal the end iterator when
an error or end-if-file occurs. How do I induce an end-of-file?
I simply cannot get this program to terminate normally because the call to
list's constructor never returns since I never finish iterating over the
range specified since I don't know how to induce an end-of-file!
Thanks,
Dave