Boost Users :
Subject: Re: [Boost-users] Question on boost multi-index container erase method
Date: 2008-10-09 02:00:00
> Apologies for a late response, i was on travel.
> Thank you very much. Works perfectly. I checked the prototype for
> erase - it returns a count of objects that it erases, in my case -
> after I made the code change as you suggested, compiler flagged an
> error saying couldnt convert iterator to size_t type.
> error: cannot convert
>>> ' to 'size_t' in initialization
> Is the datatype of status wrong?
Oh, yes, it is wrong, I overlooked that on my previous post.
erase(iterator) does not
return a count of erased elements but an iterator to the element
following the one that
was erased. It is erase(const key_type&) that returns a count. This is
at http://tinyurl.com/3k728t and mimics the interface of STL associative
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
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