Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost multiindex: Usage of erase
From: Igor R (boost.lists_at_[hidden])
Date: 2009-01-05 04:22:29


> bool ACtr::pruneBad {
>
> for ( tMap::index_iterator<timestamp>::type it =
> AContainer.get<timestamp>().begin(), it_end =
> AContainer.get<timestamp>().end();it != it_end; count++)
> {
> it = AContainer.erase(it);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> }
> }

You apply erase() to AContainer, i.e. to its 1st index, but you pass
an iterator of the 2nd index. I guess you could write something like
this:
AContainer.get<timestamp>().erase(it);


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net