Joaquin M Lopez Munoz
Matwey V. Kornilov
writes: 09.03.2015 10:02, Joaquin M Lopez Munoz пишет:
iterator_to does not do any kind of search based on x, but takes a reference to an element of the container and returns an iterator to it (roughly speaking, converts an element pointer to a node pointer). [...]
As far as I understand, there should be some pointer magic, like the following
struct node { T obj; ... // Rest };
so given x, (node*)&x will point to the struct enveloping the object and should provide access to index-specific data to allow iterator incrementation and dereferencing. What kind of additional data is stored in node?
None [...]
I think I misunderstood your question. Of course nodes store additional data other than the value itself. The data depends on the indices making up your container. A short explanation on this is given at: http://stackoverflow.com/a/4208349/213114 Joaquín M López Muñoz Telefónica