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
Ah there might be a problem with iterator stablity:
std::deque:
insertion and deletion at either end of a deque never invalidates pointers or references to the rest of the elements.
erase(): All iterators and references are invalidated, unless the erased elements are at the end or at the beginning of the container, in which case only the iterators and references to the erased elements are invalidated. The end() iterator is also invalidated unless the erased elements are at the beginning of the container and the last element is not erased.
std::list:
Adding, removing and moving the elements within the list or across several lists does not invalidate the iterators or references. An iterator is invalidated only when the corresponding element is deleted.
So we cannot properly cache with std::deque if the erasure happens in the middle of the queue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code qualityDoes not alter behavior, but beauty of our codeimprovementEnhancement of an existing componentlang: c++Done in C++ code
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same as #1635 but with deque.