hashtable local iterator

Christopher Jefferson caj21@st-andrews.ac.uk
Wed Dec 14 11:41:00 GMT 2011


On 13 Dec 2011, at 21:18, François Dumont wrote:

> Hi
> 
>    Since modification of hashtable implementation I was quite unhappy of the impact on local_iterator and especially on the end(size_type bkt) method that required to loop through all bucket nodes to access the past-the-end one. This is why I would like to propose, if it is still time, this new local iterator implementation that allow to implement begin(size_t)/end(size_t) in constant time. Note that:
> - this new iterator type needs a pointer to its parent container to work which is quite unusual on normal iterators.

This won't work with swap, which shouldn't invalidate iterators.

Without looking at the data structure in detail (sorry), do you need a pointer to the base object, or just some one of it's dynamically allocated members? Could you store a pointer to that?



More information about the Libstdc++ mailing list