
18 May
2007
18 May
'07
1:26 p.m.
"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.