[libcxx-commits] [PATCH] D124332: [libc++] Implement ranges::for_each{, _n}

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 2 14:25:54 PDT 2022


var-const accepted this revision.
var-const added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp:100
+
+  { // check that an emptry range works
+    {
----------------
Nit: `s/emptry/empty/`.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp:57
+      int i = 0;
+      ret.fun(i);
+      assert(i == 4);
----------------
philnik wrote:
> var-const wrote:
> > Can you also check that it works when the functor is move-only (since the standard mandates that `for_each_result` should initialize the functor by moving)?
> A functor can't be move-only. It's mandated that it's copy-constructible by `indirectly_unary_invocable`.
Thanks for explaining.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124332



More information about the libcxx-commits mailing list