[libcxx-commits] [PATCH] D127130: [libc++] Implement ranges::lexicographical_compare

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 13 14:42:57 PDT 2022


var-const accepted this revision.
var-const added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.lex.comparison/ranges.lexicographical_compare.pass.cpp:189
+      int a[] = {1, 2, 3, 4, 5};
+      auto ret = std::ranges::lexicographical_compare(std::begin(a), std::end(a), std::begin(a), std::end(a), pred, proj1, proj2);
+      assert(!ret);
----------------
philnik wrote:
> var-const wrote:
> > Question: why is `std::begin` necessary here?
> It's not necessary, but I think `std::begin` and `std::end` should always go together. It is just another thing you have to think about otherwise.
Sorry, what I meant was, why not just use `(a, a + 5, a, a + 5, red, proj1, proj2)`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127130/new/

https://reviews.llvm.org/D127130



More information about the libcxx-commits mailing list