STL in gcc 2.95.1

Phil Edwards pedwards@jaj.com
Sun Oct 31 23:03:00 GMT 1999


> this is actually not a bug but rather some defficiency of STL
> implementation which goes with gcc-2.95.1.

There is no deficiency here; operator[] is not specified for the
multimap template class in the ISO Standard.  It does not have to
be there.  (Besides which, op[] doesn't exactly defeat the purpose
of multimap, but its semantics wouldn't be intuitive and obvious,
at least in my opinion.)


> Namely, there is no operator[] for multimap class and I think
> it should be there. I think just copying this operator from
> map class will help here, but am not sure.

Well, I have no authority here, but you're welcome to experiment
with adding that function.  A large part of libstdc++-v3 is adapted
from the STL subset from SGI's implementation; I believe we use
their associative containers directly.  I wouldn't expect somebody
else to do the work just because you think it should be there,
however.  It definitely is not a defect according to the Standard,
and I myself wouldn't expect to see op[] in a standard multimap.

If you come up with a working implementation, suggest it on the
libstdc++-v3 mailing list and see what people think.


-- 
philip.edwards@{sn.wpafb,afrl}.af.mil
Targeting & Attack Radar              PGP ID              UFOs are real.
U.S. Air Force Research Labs        0xDBABC04F            The Air Force
Senior Unix Systems Administrator                         doesn't exist.



More information about the Gcc-bugs mailing list