Details
- Reviewers
Mordante var-const - Group Reviewers
Restricted Project - Commits
- rG80045e9afa2f: [libc++] Implement ranges::for_each{, _n}
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Looking pretty good, just a few comments.
libcxx/include/__algorithm/ranges_for_each_n.h | ||
---|---|---|
51 | Nit: move __func as well? | |
libcxx/include/algorithm | ||
967 | Please update the synopsis as well. | |
libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp | ||
11 | Please add the synopsis. | |
31 | Please also check the indirectly_unary_invocable constraint. | |
45 | Please also check with an empty range. | |
49 | Nit: decltype(auto). | |
57 | 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)? |
libcxx/include/algorithm | ||
---|---|---|
967 | (note that you'll probably need to add for_each_result to the synopsis) |
libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp | ||
---|---|---|
57 | A functor can't be move-only. It's mandated that it's copy-constructible by indirectly_unary_invocable. |
Nit: move __func as well?