This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]