
30 Aug
2004
30 Aug
'04
1:26 p.m.
I have a question about the 'modify' method of ordered indexes in the multi_index library. I have an iterator obtained from an ordered index and would like to modify the pointed element. I'm pretty sure that the modification won't change the order, won't create collisions and so on. The documentation suggests to use either 'replace', or more efficient 'modify' method. Why can't I do the following: typedef variables_t::nth_index<1>::type index_t; index_t& index = variable_declarations.get<1>(); index_t::iterator existing = index.find(vd); const_cast<Variable_declaration&>(*existing) .make_external(); ? TIA, Volodya