[PATCH] D24842: Add StringRef {take, drop} x {_while, _until}

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 09:06:22 PDT 2016


Bringing iterator support to StringRef is probably worth discussing, but it
seems orthogonal to this CL.

What might be worth doing now is adding StringRef::find_if and then having
these functions use that.

This could then be used to implement such operations as split_if() (perhaps
in a different CL though). Thoughts?


On Thu, Sep 22, 2016 at 10:11 PM Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:

> sanjoy added a subscriber: sanjoy.
> sanjoy added a comment.
>
> Have you considered adding `StringRef(iterator, iterator)` constructor,
> and replacing the explicit loops with `std::find_if` and `std::find_if_not`.
>
>
> https://reviews.llvm.org/D24842
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/1af83c97/attachment.html>


More information about the llvm-commits mailing list