This adds support for some common functional style operations that allow you to take or drop characters until a certain condition is met.
Example:
assert(StringRef("ABCD2908XYZ".take_while([](char c) { return ::is_hexdigit(c); }) == "XYZ");
Differential D24842
Add StringRef {take, drop} x {_while, _until} zturner on Sep 22 2016, 1:47 PM. Authored by
Details This adds support for some common functional style operations that allow you to take or drop characters until a certain condition is met. Example: assert(StringRef("ABCD2908XYZ".take_while([](char c) { return ::is_hexdigit(c); }) == "XYZ");
Diff Detail Event Timeline
Comment Actions Have you considered adding StringRef(iterator, iterator) constructor, and replacing the explicit loops with std::find_if and std::find_if_not. Comment Actions lgtm modulo minor comments
|
Docs?