[llvm] r225760 - Standardize {pred,succ,use,user}_empty()

David Blaikie dblaikie at gmail.com
Mon Jan 12 21:05:23 PST 2015


On Mon, Jan 12, 2015 at 8:13 PM, Ramkumar Ramachandra <artagnon at gmail.com>
wrote:

> David Blaikie wrote:
> > I'd sort of rather have a simple "empty(range)"
>
> Isn't that just a `!std::distance(.begin(), .end())`?
>

Except in the case of non-random-access-iterators (in which case distance
is O(N) instead of O(1)). It's just ".begin() != .end()" but still worth
wrapping up in a utility function for convenience/readability.

- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150112/f1b343b2/attachment.html>


More information about the llvm-commits mailing list