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++/26020] New: std::advance() isn't stable for floating point numbers


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


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