Re: [boost] [multi_index] intrusive multi_index poll for interest

----- Mensaje original ----- De: Bruno Martínez <br1@internet.com.uy> Fecha: Viernes, Enero 20, 2006 4:35 pm Asunto: Re: [boost] [multi_index] intrusive multi_index poll for interest
On Fri, 20 Jan 2006 05:52:22 -0200, Joaquín Mª López Muñoz <joaquin@tid.es> wrote:
OK, you have shown a realistic scenario where the feature is valuable, so I'm putting this into my todo list --probably I can have it in time for 1.34, but I'm very slow writing and checking> things :) Any suggestions about the name/syntax? Something like:
iterator iter_to(const value_type& x)const;
iterator_from()?
I don't know. I'm spanish speaking too.
Pues ponemos entonces dame_el_iterador(const value_type& x); :) (sólo bromeaba, saludos desde España)
Alas, iterator() can't be used as the name of the member function, since it is already a nested typedef of indices.
How is this feature implemented? Substracting char*?
Nodes are derived from the following class template<typename Value> struct pod_value_holder { typename aligned_storage< sizeof(Value), alignment_of<Value>::value
::type space; };
where "space" is used to hold the value (guaranteed to serve this purpose by TR1). Given a value_type*, we are allowed to cast it to a aligned_storage<...>* (TR1) and then to a pod_value_holder<value_type>* (std 9.2.17). From here we only need a static_cast to downcast to a node_type* (nodes are derived from pod_value_holder). And indices only need such node_type* to make an iterator. Briefly put, nodes store the value field in their first position, and a careful leverage of aligned_storage<>, POD guarantees and downcasting allows us to *portably* convert a pointer to the value to a pointer to the whole node. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

JOAQUIN LOPEZ MU?Z wrote:
----- Mensaje original ----- De: Bruno Martínez <br1@internet.com.uy> Fecha: Viernes, Enero 20, 2006 4:35 pm Asunto: Re: [boost] [multi_index] intrusive multi_index poll for interest
On Fri, 20 Jan 2006 05:52:22 -0200, Joaquín Mª López Muñoz <joaquin@tid.es> wrote:
OK, you have shown a realistic scenario where the feature is valuable, so I'm putting this into my todo list --probably I can have it in time for 1.34, but I'm very slow writing and checking> things :) Any suggestions about the name/syntax? Something like: iterator iter_to(const value_type& x)const; iterator_from()?
I don't know. I'm spanish speaking too.
Pues ponemos entonces
dame_el_iterador(const value_type& x);
Well, that pretty much translates to "get_iterator", which David Abrahams already suggested. ;-) Regards, João

João Abecasis <jpabecasis@gmail.com> writes:
JOAQUIN LOPEZ MU?Z wrote:
----- Mensaje original ----- De: Bruno Martínez <br1@internet.com.uy> Fecha: Viernes, Enero 20, 2006 4:35 pm Asunto: Re: [boost] [multi_index] intrusive multi_index poll for interest
On Fri, 20 Jan 2006 05:52:22 -0200, Joaquín Mª López Muñoz <joaquin@tid.es> wrote:
OK, you have shown a realistic scenario where the feature is valuable, so I'm putting this into my todo list --probably I can have it in time for 1.34, but I'm very slow writing and checking> things :) Any suggestions about the name/syntax? Something like: iterator iter_to(const value_type& x)const; iterator_from()?
I don't know. I'm spanish speaking too.
Pues ponemos entonces
dame_el_iterador(const value_type& x);
Well, that pretty much translates to "get_iterator", which David Abrahams already suggested.
No, I suggested get_position. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
João Abecasis <jpabecasis@gmail.com> writes:
dame_el_iterador(const value_type& x); Well, that pretty much translates to "get_iterator", which David Abrahams already suggested.
No, I suggested get_position.
Oops... My mistake. Sorry! João
participants (3)
-
David Abrahams
-
JOAQUIN LOPEZ MU?Z
-
João Abecasis