Container insertion and removal
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Mar 8 09:40:30 PST 2010
Steven Schveighoffer wrote:
> On Sun, 07 Mar 2010 06:42:10 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>
>> Iterator invalidation has been a notion thoroughly explored by the STL
>> and a commonly-mentioned liability of STL iterators. People find it
>> very jarring that syntactically identical interfaces have distinct
>> effects on iterators, it's a dependency very difficult to track. I'm
>> glad that that experience has already been accumulated and that we can
>> build upon it.
>
> Is there any experience that led to a solution, even in theory?
I don't know of one. There are of course the safe iterators that rely on
a variety of techniques (some, such as serial numbers, discussed in this
thread) to detect invalidation dynamically.
For the style of containers discussed herein, a static solution should
be a better fit than a dynamic one. I plan to enact a solution by means
of the softXxx primitives.
> I'm going to stop arguing this point any further, because the quickest
> path to resolution is probably for you to stop wasting time debating
> with me and implement what you think will work. Then we can see how
> useful it might be.
>
> If you can solve this problem in a way that is useful, I think it might
> be as revolutionary as ranges are.
Probably not. The way I see it, it would be simply the removal of a
large annoyance that stands in the way of writing container-independent
generic code.
Andrei
More information about the Digitalmars-d
mailing list