Re: [Boost-users] [MultiIndex] Iterator validity when modifying equal_range keys

Ovanes Markarian
On Fri, Sep 2, 2011 at 9:25 PM, Joaquin M Lopez Munoz
wrote: Ovanes Markarian
writes: entry_data& entries = indexed; //get the view to the MI-Container
What is this supposed to do? Usually you get an index view using get(), which you're not using here.
I thought I am getting an index view here. Isn't it done implicitly... Why am I suppose to use it than? The upper statement can be seen as:
my_index_container_type::index
::type& entries = indexed; If I am not suppose to do that this way, why does this code compile? I know the docs state I should use the
my_index_container_type::get<...> member, by how is this construct should be different?
In this particular case you're being lucky because the index you're getting is the first one and the whole multi_index_container publicly derives from it. If you tried a different index it wouldn't have worked. In general you shouldn't rely on this trick not even for index #0.
Ok thanks for your help and a great lib!
Thanks for using Boost.MultiIndex. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (1)
-
Joaquin M Lopez Munoz