
On 20/06/06, David Abrahams <dave@boost-consulting.com> wrote:
AFAICT, erasing a list node ends up being linear in the number of checked iterators into the list rather than O(1), regardless of the debug/release setting. Am I missing something?
Well, I don't see that, so at least one of us must be. Are you talking about the call to _Orphan_ptr? All those calls, and indeed the function itself, are inside #if _HAS_ITERATOR_DEBUGGING blocks. And if you look at yvals.h you see that _HAS_ITERATOR_DEBUGGING is normally 0 in a release build. The release mode code looks straightforward and constant-time to me. (Interestingly the erase(Iterator, Iterator) function looks to me to be quadratic in debug mode, which it really doesn't need to be. I guess once they decided to break the performance guarantees they wanted to *really* break them.) - Alan