-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement counted_iterator #1083
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 |
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.
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>
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_iterator
I 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
noexcept
where I feel comfortable. There are most certainly other possibilitiesThere is something strange with the
iter_move
requirement, 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