On 06/03/2018 19:31, Ken Brown wrote:
On 3/6/2018 10:18 AM, Jon Turney wrote:
(I also note we have also have another 'erase an element from a vector while we are iterating over it' here, so that needs fixing, as well)

I think this one might be OK.  If I'm not mistaken, pkg.versions.erase(i++) passes a copy of i to erase, and then increments i before erase() has done its work.  But I'm no expert on this.

I think that's still not ok for a vector, but this is actually a set, so there's actually no problem.

See e.g. [1], or refer to your copy of the C++ standard :)

[1] https://stackoverflow.com/questions/6438086/iterator-invalidation-rules

Reply via email to