Michel Fortin wrote:
On 2010-03-06 14:55:49 -0500, Andrei Alexandrescu
<[email protected]> said:
Steven Schveighoffer wrote:
How can softRemove not affect iterating ranges? What if the range is
positioned on the element removed?
With GC, you can softRemove things without invalidating iterators.
What exactly is an "invalidated" iterator? Is an iterator that no longer
points to the container still "valid"? Or is "valid" just another word
for "memory safe"?
Wouldn't the notion of "detached" iterators/ranges be more useful?
Good question. In STL, invalidation roughly means undefined behavior if
you use it. With GC in tow, the concept could be significantly milder.
For example, reallocating an array would leave the old contents of the
array sort of around, just obsoleted and also depleted of meaningful
content if the data type has a destructor.
Andrei