This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: istream_iterator bug
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-bugs at gcc dot gnu dot org, nbecker at hns dot com
- Date: Tue, 6 Aug 2002 11:13:45 -0700
- Subject: Re: istream_iterator bug
Don't need all the copy bits to reproduce it, actually. I'm not quite
sure you'd need the standard library either.
-benjamin
#include <iterator>
#include <fstream>
#include <sstream>
int main ()
{
using namespace std;
ifstream f("test");
istringstream s("test");
// 1
istream_iterator<int> one(f);
// 2
istream_iterator<int> two(s);
// 3
istream_iterator<int> three(istream());
#if 1
// 4
istream_iterator<int> four(istringstream("test2"));
// istream_iterator<int> four(ifstream("test2"));
#endif
}