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]

[Bug libstdc++/51881] istream_iterator copy leads to incorrect value read


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51881

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-17 13:10:15 UTC ---
Or for a better example, this is basically what your program tries to do:

    foo f;
    f.v = std::vector<int>(3);
    while (ss >> f)
        std::cout << f << '\n';

That shows the same problem.

Compare it with e.g.

    std::string s = "0 0 0";
    while (ss >> s)
        std::cout << s << '\n';

which doesn't keep appending to the string.


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