This is the mail archive of the gcc@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]

Re: STL question


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).


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