Enumerate with arbitrary starting index#1800
Enumerate with arbitrary starting index#1800serpent7776 wants to merge 3 commits intoericniebler:masterfrom
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
enumerateso 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).