C++ bug with gcc version 2.95-2

Ross Smith ross.s@ihug.co.nz
Fri Dec 31 20:54:00 GMT 1999


Sunil Rottoo wrote:
> 
> Hi,
> 
> The following code which compiled with version 2.91 of gcc no longer
> works with version 2.95-2.
> It appears that all mutating STL algorithms which operate on a map have
> the same problem.

The compiler is right. Many of the mutating algorithms don't work on
associative containers, because the algorithms rely on being able to
rearrange the elements, but in associative containers, the order of
elements is fixed.

--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
    "Be careful about using the following code -- I've only proven
    that it works, I haven't tested it."           -- Donald Knuth



More information about the Gcc-bugs mailing list