-
Notifications
You must be signed in to change notification settings - Fork 438
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
Enumerate with arbitrary starting index #1800
base: master
Are you sure you want to change the base?
Conversation
How come?
You can avoid those. For both, you can have For only the first one, you can parameterize the size. |
When I tried modifying the last test to use enumerate with custom index start I got compilation error
I'm assuming this is because range-v3/include/range/v3/view/enumerate.hpp Line 116 in 97452bb
I could change that to RANGES_INLINE_VARIABLE(enumerate_fn, enumerate) and add overload
This is interesting, but I'm assuming you meant
I don't think I understand. |
I meant something similar to how the bound of |
I updated the code, so that it works with both function call syntax and piping syntax. I looked at existing code in |
I'd like to ask if the existing solution is OK or should I go with eliminating the size overhead of |
ping @JohelEGP ? |
This comment was marked as duplicate.
This comment was marked as duplicate.
I think you want feedback from a maintainer now. |
Improves
enumerate
so that it's possible to start at any given index. Similar functionality exists in boost::adaptors::indexedThis is just a draft, it just adds an additional parameter to
enumerate_fn::operator()
. It works well when used with function call syntax, but:index_view
(not sure if an issue)enumerate
(probably not an issue)Another way to implement this would be to transform constructed
zip
, but I'm not sure that's any better (also doesn't fix the first issue).