[libcu++] Rework our handling of iterator_category#8849
Merged
Conversation
miscco
commented
May 6, 2026
Contributor
Author
miscco
left a comment
There was a problem hiding this comment.
Note: I still need to add more tests, but I want to see whether things break first
0199d6c to
ed18166
Compare
This comment has been minimized.
This comment has been minimized.
We often only look for `iterator_category` to decide whether we can use more efficient implementations. This does not play well with the C++20 iterators, which often have `input_iterator` as their `iterator_category` and the actual information stored in `iterator_concept` Consequently we check whether something has `iterator_concept` defined and if so we use the higher of `iterator_concept` and `iterator_category`
545980c to
b132617
Compare
b132617 to
80c7ad5
Compare
This comment has been minimized.
This comment has been minimized.
Jacobfaib
approved these changes
May 7, 2026
Contributor
🥳 CI Workflow Results🟩 Finished in 3h 18m: Pass: 100%/170 | Total: 5d 04h | Max: 2h 30m | Hits: 73%/455417See results here. |
1 task
bernhardmgruber
approved these changes
May 7, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We often only look for
iterator_categoryto decide whether we can use more efficient implementations.This does not play well with the C++20 iterators, which often have
input_iteratoras theiriterator_categoryand the actual information stored initerator_conceptConsequently we check whether something has
iterator_conceptdefined and if so we use the higher ofiterator_conceptanditerator_category