Boost logo

Boost :

From: Alan Stokes (alan_at_[hidden])
Date: 2006-06-22 06:06:42


On 20/06/06, David Abrahams <dave_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk