[libcxx-commits] [PATCH] D126610: [libc++] Implement ranges::adjacent_find

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 3 21:59:25 PDT 2022


var-const requested changes to this revision.
var-const added a comment.
This revision now requires changes to proceed.

Almost LGTM, just a couple of test cases that can be added.



================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp:33
+template <class Iter, class Sent = Iter>
+concept HasAdjacentFindIt = requires (Iter iter, Sent sent) { std::ranges::adjacent_find(iter ,sent); };
+
----------------
Nit: `s/ ,/, /`.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp:100
+  test_iterators<const int*>();
+
+  { // checkt that ranges::dangling is returned
----------------
Can you also add two test cases to check that a non-default projection and a non-default predicate work?


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp:101
+
+  { // checkt that ranges::dangling is returned
+    [[maybe_unused]] std::same_as<std::ranges::dangling> auto ret = std::ranges::adjacent_find(std::array{1, 2, 3, 4});
----------------
Nit: `s/checkt/check/`.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp:102
+  { // checkt that ranges::dangling is returned
+    [[maybe_unused]] std::same_as<std::ranges::dangling> auto ret = std::ranges::adjacent_find(std::array{1, 2, 3, 4});
+  }
----------------
Nit: `decltype(auto`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126610



More information about the libcxx-commits mailing list