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