
I am having problems using the modify method with my composite_key. Here is my multi_index container definition: typedef multi_index_container< entry, indexed_by< ordered_unique<member<entry,DataVertex,&entry::m_vertex> >, ordered_non_unique< composite_key< entry, member<entry,int,&entry::m_y>, member<entry,int,&entry::m_x> > > > > C; C m_c; namespace ll=boost::lambda; typedef nth_index<C,1>::type XYINDEX; I have a XYINDEX::iterator that is defined using the equal_range method of an XYINDEX order. Now I wish to modify the m_x attribute that this iterator points to so I attempt to write: inline void Positioner::updateX(XYIterator iter,int x) { m_c.modify(iter,(&ll::_1)->*&Positioner::entry::m_x=x); } I get this compiler error: positioner.h:77: error: no matching function for call to 'boost::multi_index::multi_index_container<Positioner::entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::member<Positioner::entry, unsigned int, &Positioner::entry::m_vertex>, mpl_::na, mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::composite_key<Positioner::entry, boost::multi_index::member<Positioner::entry, int, &Positioner::entry::m_y>, boost::multi_index::member<Positioner::entry, int, &Positioner::entry::m_x>, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<Positioner::entry>
::modify(boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::index_node_base<Positioner::entry> , mpl_::na>&, const boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::other_action<boost::lambda::assignment_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::action<2, boost::lambda::other_action<boost::lambda::member_pointer_action> >, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::other_action<boost::lambda::addressof_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholder<1> , boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, int Positioner::entry::* const, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, const int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >)'
I have also tried: m_c.modify_key(iter,ll::_1=x); But this gives me this error: positioner.h:78: error: no matching function for call to 'boost::multi_index::multi_index_container<Positioner::entry, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::member<Positioner::entry, unsigned int, &Positioner::entry::m_vertex>, mpl_::na, mpl_::na>, boost::multi_index::ordered_non_unique<boost::multi_index::composite_key<Positioner::entry, boost::multi_index::member<Positioner::entry, int, &Positioner::entry::m_y>, boost::multi_index::member<Positioner::entry, int, &Positioner::entry::m_x>, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<Positioner::entry>
::modify_key(boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::index_node_base<Positioner::entry> , mpl_::na>&, const boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::other_action<boost::lambda::assignment_action>, boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholder<1> , const int, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >)'
While a method like this compiles and works, I would like to be more efficent: inline void Positioner::updateX(DataVertex vertex,int x) { C::iterator iter=m_c.find(vertex); assert(iter!=m_c.end()); m_c.modify(iter,(&ll::_1)->*&Positioner::entry::m_x=x); } Can somebody tell me if what I'm trying to do is possible? If so, how?