[cfe-dev] [libc++] debug mode

M.E. O'Neill oneill at cs.hmc.edu
Mon Sep 19 09:32:35 PDT 2011


Howard Hinnant wrote:
>> This is an interesting approach.  But one problem with it is that it only allows the system to invalidate all iterators referring to a container.  It can't invalidate a subset of them.  And we need to be able to invalidate subsets of iterators (e.g. during vector::erase).
>> 
>> Or have I missed something?

and I replied:
> In situations where *some* of the iterators get invalidated, you need to do a little bit more work.  You need to maintain an invalidation log [...]

Incidentally, I was thinking about things like std::vector here.  For some other cases, such as std::list or the tree-based data structures, things are easier.  For those, I think you just have to associate the tags with the "nodes" of the container rather than the whole container.

    M.E.O.





More information about the cfe-dev mailing list