-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement counted_iterator #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I have added some unit tests. There are two remaining major problems:
I have uncommented them for now to get the tests passing -at least locally- so that we can flesh out some other potential bugs through other compiler/configurations NOTE: this is also missing tests for the |
CaseyCarter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick sweep over the class itself.
miscco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied the review comments as far as I can. there were some where I had a question
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
|
Given that the probability of using Thakns to @AdamBucior |
… coverage Giveup on `counted_iterator` ever working in MSVC's permissive mode; add strict_concepts test matrix and change winsdk_concepts to strict_winsdk_concepts. Also communicate the constant iterator type to which a `test::iterator` can be converted via an oddly-named nested type alias `Consterator` that shouldn't inadvertently match any other use cases. Wiggle converting constructor tests a bit to ensure they're testing `counted_iterator`'s conversions and not the adapted iterator's conversions. Guard cross-type difference and comparison tests with their prerequisite condition `common_with` which doesn't hold for move-only iterators. Give `_Same_sequence` a descriptive comment.
CaseyCarter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm requesting changes to the things that I just changed. I can totally do that.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Commit STL's tweaks. Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Comment change I overlooked in the previous update. Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
|
I knew I could count on you to get this implemented! 😎 |
This is a work in progress implementation of
std::counted_iteratorI am quite happy where I am right now. However, there are quite some sharp edges I would like to discuss.
The standard has a frequent precondition that both iterators should be of the same range. It is rather tough to implement that. I tried my best but maybe you have a better idea.
I have strengthened
noexceptwhere I feel comfortable. There are most certainly other possibilitiesThere is something strange with the
iter_moverequirement, as it fails forstd::vector<int>in the death tests.I have some further work in progress regarding actual unit tests beyond the iterator machinery, but they need way more polish so I have not yet added them.
Partially addresses #39