|
Boost Users : |
From: Francesco Biscani (bluescarni_at_[hidden])
Date: 2006-10-27 09:26:04
Hi Joaquín,
first of all thanks for your answers. I find your replies always very
helpful :)
I think I've understood what you mean. Just let me recap to see if I got it
right.
1. There are two ways to make sure a modification with traversal is
successful:
2. I can traverse an index (hashed or ordered, it does not matter) to modify()
all the elements of the container if I am sure that the modification does not
change the representation of the elements with respect to the index I'm
traversing on.
2a. For example, I can use the hashed index for traversing whenever I'm sure
that the modifications won't change the hash value of the elements.
2b. Or I can use an ordered index whenever I'm sure that the modification does
not change the position of the element in the binary search tree.
3. I can also traverse and modify an ordered index from top to bottom if I'm
consistently modifying each element to place itself _higher_ in the tree than
it was before. In the opposite way I can traverse bottom to top if I'm
consistently modifying the element to be _lower_ in the tree.
So, in my case I was using an hashed index traversal while I was changing the
hash values. It's a no-go. However I also have an ordered index already
defined, and the modification I want to do does not change the ordering of
elements. Hence the use of a sorted index for this purpose is safe.
Does this make sense? :)
Thanks again,
Francesco
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net