[libcxx-commits] [PATCH] D117817: [libc++][ranges] Implement ranges::mismatch

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 2 14:52:45 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/__algorithm/ranges_mismatch.h:47
+    while (__first1 != __last1 && __first2 != __last2) {
+      if (!invoke(__pred, invoke(__proj1, *__first1), invoke(__proj2, *__first2)))
+        break;
----------------
Quuxplusone wrote:
> Quuxplusone wrote:
> > philnik wrote:
> > > Quuxplusone wrote:
> > > > philnik wrote:
> > > > > Quuxplusone wrote:
> > > > > > `_VSTD::invoke` throughout; and please add a regression test involving `Holder<Incomplete>*`.
> > > > > > https://quuxplusone.github.io/blog/2019/09/26/uglification-doesnt-stop-adl/
> > > > > Using `Holder<Incomplete>*` currently errors in `input_range`, so I won't put a regression test in since fixing `input_range` is out of scope for this PR.
> > > > Yikes, I see this now: https://godbolt.org/z/WPzrhda1f  Is that the problem you mean?  If so, OK, no-regression-test is fine.
> > > Yes.
> > This is now D118213, so hopefully by end-of-week you can add that regression test after all. :)
> > ```
> > Holder<Incomplete> *a[3] = {};
> > Holder<Incomplete> *b[4] = {};
> > auto [ai, bi] = std::ranges::mismatch(a, b);
> > assert(ai == a+3);
> > assert(bi == b+3);
> > ```
> D118213 is landed! So you should be able to add the above test now.
Now it fails in `iterator_traits.h:150`. I don't really understand why and I also don't feel like fixing all the concepts before landing this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117817



More information about the libcxx-commits mailing list