Alfredo Braunstein wrote:
Jean-Marc Lasgouttes wrote:
Alfredo Braunstein <[EMAIL PROTECTED]>
writes:
I don't think it's possible unfortunately, for the reasons in my other
post. We could have a O(1) RandomAccessList::getIterator(int pos) but
it's obviously not so cool ;-) And it doesn't work for advancing an
existing iterator.
I am not sure why we need this std::list behaviour actually. A
vector<Paragraph*> that looks like a vector<Paragraph> would be
enough, IMO. I remember that Lars wanted this list thing, but I do not
remember why.
Good idea, specially because what we have now is: "slow iteration as a list,
slow insertion as a vector" ;-)
Not really, what we have now is "fast iteration as a vector, fast
insertion as a list"...
The only drawback of the list based solution is that there is a little
memory overhead. The advantage is of course that the problem below is
easily solved:
The only problem could be if we assume list-type iterator stability on
insertion. Not many cases (if any) I presume, but hard to catch.
Abdel.