From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-05-18 09:26:45
"JOAQUIN LOPEZ MU?Z" wrote:
> Hi Peter,
>> void X::f()
>> iterator i = iterator_to( *this );
> Yep, but what would you want this iterator for? In the
> case of intrusive containers, the usual answer is
> "to extrat the object from the container". In the case
> of B.MI, which is not intrusive, erasure involves
> destruction, so things are not so clear.
I think that I needed it once to make the object erase itself from its
container. You can traverse the container until you find the object, so a
helper function is not strictly required, O(1) vs O(N) notwithstanding.
I can't recall other use cases for it.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk