[llvm] r243996 - Avoid passing nullptr to std::equal.

Marshall Clow via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 11:38:28 PDT 2015


On Tue, Aug 11, 2015 at 2:15 PM, Yaron Keren via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> I'm not sure how std::equal of two nullptrs should be, is this documented
> or UB?
>
>
Well, if you did this:
  std::equal(nullptr, nullptr, nullptr), you should get true.

[nullptr,nullptr) is a valid, empty range.
And an empty range is equal to another empty range.

-- Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150812/6dc0dcd4/attachment.html>


More information about the llvm-commits mailing list