This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hashtable local iterator


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.


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