Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-30 08:26:20


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk