You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(stl): return the immediate successor from flat_map and flat_set erase #4522
flat_map::erase and flat_set::erase compute pos + 1 before the backing vector shifts elements left. The returned iterator therefore skips the immediate successor. Erasing the last element returns the old end, which is beyond the new end. The backing vector erase already returns the correct index.
Repro: erase begin() from {1,2,3}; expected iterator to 2, actual iterator to 3.
Proposal
Return the iterator at the erased index after deletion, matching standard erase semantics.
Acceptance criteria
Add focused RED→GREEN tests for first, middle, and last erasures in both containers.
Cover iterator and const_iterator overloads; last-element erasure returns the new end().
Decisions
Combine map and set because they contain the same defect and should share one API contract.
Priority: medium; erase-while-iterating can silently skip entries.
Activity