Skip to content
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

[utils] Implemented Enumerate iterator adapter (#28) #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

derzhavin3016
Copy link
Member

Closes #28

@derzhavin3016 derzhavin3016 marked this pull request as ready for review July 24, 2022 15:57
include/utils/utils.hh Outdated Show resolved Hide resolved
include/utils/utils.hh Outdated Show resolved Hide resolved
- Removed class template specialization for rvalue reference by specifying storage type of container conditionally
- Added tests for checking move semantic's work
- Removed requirement of ::iterator type in container
- To prevent changing of counter, made it const in reference & value type
- Removed useless dummy_ variable because of errors while using it
- Replaced makeEnumerate w/ ctor with deduction hint
- Added size method for enumerate
- Added test with constant container
- Removed const from reference & value_type
- Removed operator!= for EnumerateIt (generated by default)
- Renamed Enumer -> Enumerate
@derzhavin3016
Copy link
Member Author

I think we can merge it after I add test for ordinary array as a container

@derzhavin3016 derzhavin3016 self-assigned this Aug 9, 2022
Comment on lines +43 to +44
using difference_type =
std::pair<std::make_signed_t<std::size_t>, typename std::iterator_traits<It>::difference_type>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really should be a pair? Maybe just number is enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add enumerate adaptor
2 participants