c++boost-multi-index

In boost::multi_index, will modifying a field, which is a key in another index, cause that index to reshuffle?


The situation is as follows: I'm having a bmi, indexed by hashed_unique over a name field of the struct and ordered_non_unique, over the status field of the same struct. The question is: if I invoke modify() on the hashed_unique index and modify a status field with it, will this cause a rebalance on the ordered_non_unique index? Or should I explicitly use modify() on the ordered_non_unique index while altering status in order to keep it updated?


Solution

  • modify will cause all indices to reorder as necessary regardless of which index it is called on.