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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 25 20:43:45 PST 2022


Quuxplusone 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;
----------------
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);
```


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