Код:
struct Event
{
/*event id*/
unsigned int m_nID;
/*event priority*/
EEventPriority m_ePrior;
/*type of events*/
EEventTypes m_evTypes;
/*busy flag*/
bool m_bBusy;
/*startup event time*/
time_t m_startup_time;
/*expired event time*/
time_t m_expired_time;
};
//------------------------------------------------------------------------------
struct nID{};
struct ePrior{};
typedef boost::multi_index::multi_index_container<
Event,
boost::multi_index::indexed_by
<
boost::multi_index::ordered_unique
<
boost::multi_index::tag<nID>, BOOST_MULTI_INDEX_MEMBER(Event, unsigned int, m_nID)
>,
boost::multi_index::ordered_non_unique
<
boost::multi_index::tag<ePrior>, BOOST_MULTI_INDEX_MEMBER(Event, EEventPriority, m_ePrior)
>
>
> eventsPool;
typedef eventsPool::index<nID>::type nID_sub_arr;
typedef eventsPool::index<ePrior>::type ePrior_sub_arr;
ePrior_sub_arr::iterator itr = m_eventsPool.get<ePrior>().begin();
(*itr).m_bBusy = true; //error C3892: 'itr' : you cannot assign to a variable that is const
Как изменить что то в multi_index через итератор?