
Hi Peter, ----- Mensaje original ----- De: Peter Dimov <pdimov@mmltd.net> Fecha: Jueves, Mayo 17, 2007 9:12 pm Asunto: Re: [boost] [multi_index] use cases for iterator_to() Para: boost@lists.boost.org
"JOAQUIN LOPEZ MU?Z" wrote:
Hello,
More than a year ago a request was made for Boost.MultiIndx to provide the ability to get an iterator to an element x from x alone:
iterator iterator_to(const value_type& x);
I can provide this functionality in constant time, and the internal implementation is trivial, but I got thinking about the potential use cases for such capability and cannot come up with something convincing.
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. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo