This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: STL question
- To: oliva at dcc dot unicamp dot br (Alexandre Oliva)
- Subject: Re: STL question
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Mon, 28 Sep 98 9:21:41 PDT
- Cc: spike at Gambit dot Msk dot SU, egcs at cygnus dot com
Alexandre Oliva writes:
> Unlike map, hash_map does not support insert(pos,x), so insert
> iterators do not work on it :-(
I think that this is a design bug. STL containers should be as orthogonal
as possible. (and since hash_map is an extension, it can be fixed without
having to worry about violating the standard.
> Perhaps insert iterators should be specialized for hash maps...
Or perhaps insert(iterator, value) should be implemented for hash maps,
in an analogous way as for maps (the iterator position is only taken as
a hint, which can be ignored if necessary).