
[Please don't top-post, see http://www.boost.org/community/policy.html#quoting ] Eli Zakashansky escribió:
Joaquín hi,
I understand perfectly what u tried to do (and also experienced such problems before), therefore I verified that after I obtain the index(idx = container->get<INDEX>();) it is not changes (only read methods such as end(), begin() etc. are invoked) until I try to remove an element from the container (idx.erase(iterator);), and on the first try I try to call erase the assertion pops up.
Well, where does iterator come from? Is there any chance that a) it's end() because the lookup condition was not met? b) it's invalid because you already deleted the element it was pointing to? c) it belongs to a different container? Have you swapped containers, maybe? Is this systematic, i.e. does it happen the first time that particular line of code is hit, or does it happen more or less at random? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo