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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 10 08:10:39 PST 2022


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/mismatch/ranges_mismatch.pass.cpp:12
+// UNSUPPORTED: libcpp-has-no-incomplete-ranges
+
+#include <algorithm>
----------------
Please document what you're testing by adding the synopsis here. That's what we do everywhere else.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/mismatch/ranges_mismatch.pass.cpp:21
+template <class Iter1, class Iter2>
+constexpr void test_iterators(Iter1 begin1, Iter1 end1, Iter2 begin2, Iter2 end2, int* expected1, int* expected2) {
+  using Expected = std::ranges::mismatch_result<Iter1, Iter2>;
----------------
You could easily inline that function into the only place where it's called (unless I missed a second usage?).


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/mismatch/ranges_mismatch.pass.cpp:37
+
+constexpr void test_sentinel() {
+  int a[] = {1, 2, 3, 4, 5};
----------------
Please inline those `test_foo()` functions into the body below, and separate them with scopes like we've started doing:

```
// meaningful comment
{
  <...>
}
```

Using a comment allows for something more descriptive than just `test_sentinel`.



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