4 ms·
I think it should be bidirectional. Random access is expected to mean O(1) advancing of the iterator. I don't think it can be done without upfront work and allo
by leni536 6y ago
I think it should be bidirectional. Random access is expected to mean O(1) advancing of the iterator. I don't think it can be done without upfront work and allocation at construction.
If one needs random access they can always do the bidirectional range -> vector of string_views conversion.
Ranges are relatively new in the standard and not many algorithms landed in the library. I'm pretty sure there will be many new range algorithms in the upcoming standards. This particular algorithm is probably worth suggesting. I recommend floating the idea on the cpplang slack (there are #ranges and #future_standard channels) and/or the std-proposals mailing list. I never wrote a proposal, but you can chat with people who did.
https://cpplang.slack.com/ https://cpplang.slack.com/
You can get an invitation here: https://cpplang-inviter.cppalliance.org/ https://cpplang-inviter.cppalliance.org/
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals