[libcxx-commits] [PATCH] D107500: [libc++][ranges] Implement `lazy_split_view`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 17 15:39:56 PDT 2022


var-const marked an inline comment as done.
var-const added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp:23-31
+template <class T, size_t N, class Separator, class U, size_t M>
+constexpr bool test_function_call(const T (&input)[N], Separator separator, std::array<U, M> expected) {
+  std::ranges::lazy_split_view v(input, separator);
+
+  return std::equal(v.begin(), v.end(), expected.begin(), expected.end(),
+      [](const auto& split_value, const auto& expected_value) {
+        return SmallString(split_value) == expected_value;
----------------
var-const wrote:
> philnik wrote:
> > Nit: I think the usual pattern is to have the function return `void` and assert inside the function. Same with `test_with_piping`.
> I'll address this comment tomorrow.
I have significantly reduced the boilerplate based on your suggestion. Do you still feel the assertion should be moved into the most nested function in the call? It seems like the higher it is in the call stack, the less output there is to read in case of an error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107500



More information about the libcxx-commits mailing list