This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26020] New: std::advance() isn't stable for floating point numbers
- From: "Woebbeking at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2006 23:06:34 -0000
- Subject: [Bug libstdc++/26020] New: std::advance() isn't stable for floating point numbers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
i.e. code like
list<int> bla;
// insert some stuff into bla
list<int>::iterator it(bla.begin());
advance(it, bla.size() * 0.5);
can lead to an endless loop. I know that the code is "broken" but it should
work nevertheless. Please change the code to < 0 and > 0, not just while (n--).
Cheers,
André
--
Summary: std::advance() isn't stable for floating point numbers
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Woebbeking at web dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26020