This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: hashtable local iterator
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 14 Dec 2011 11:17:25 +0100
- Subject: Re: hashtable local iterator
- References: <4EE7C11F.7030109@gmail.com> <4EE7F286.6000203@oracle.com>
On 12/14/2011 01:49 AM, Paolo Carlini wrote:
- this new iterator type needs a pointer to its parent container to
work which is quite unusual on normal iterators.
On the spot, I cannot see anything wrong with this. Normally, when
such kinds of links are present one must be careful about what happens
when one of the two changes without telling the other. Are we risking,
I don't know, local iterators becoming invalid when they shouldn't?
In particular, I would double check swap, which is supposed to not
invalidate any iterator.
Besides what the Standard literally says, constant complexity, I think
it's very important from the QoI point of view that all the begin/end
member functions are very simple, because user code normally ends up
using those in loops, everywhere. If that means we have to use a little
more memory, I think it's in general fine (previous double checking what
the other implementations appear to be doing).
Please let us know asap how are we doing on this.
Paolo.