[PATCH] D23965: Add StringRef::keep_front() and StringRef::keep_back()

Paweł Bylica via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 28 14:26:05 PDT 2016


chfast added a subscriber: chfast.
chfast added a comment.

In https://reviews.llvm.org/D23965#527297, @zturner wrote:

> In https://reviews.llvm.org/D23965#527296, @majnemer wrote:
>
> > Sounds like a useful API.  The term I've heard of in other programing languages is "take", I think `take_front` and `take_back` might be a little nicer.
>
>
> `take_front` sounds ok, but `take_back` sounds awkward to me.  I almost want to say "take what back?"  If the convention was `drop` and `rdrop`, then `take` and `rtake` would sound good, but I'm not crazy about `take_front` and `take_back`.  I could probably be convinced though if the majority prefers it.


So maybe `take_first` and `take_last`?


https://reviews.llvm.org/D23965





More information about the llvm-commits mailing list