Details
- Reviewers
ldionne Mordante var-const - Group Reviewers
Restricted Project - Commits
- rGff6d5dee713c: [libc++] Implement ranges::replace{, _if}
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The implementation looks great. Just need to add a few test cases and update the synopsis. Thanks!
libcxx/docs/Status/RangesAlgorithms.csv | ||
---|---|---|
51–53 | Please don't forget to update this with an actual link. | |
libcxx/include/algorithm | ||
1173 | You probably need to update the synopsis as well. | |
libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp | ||
15 | Can you also add the synopsis so that the algorithm signature is easy to look up when reading the test file? | |
21 | Can you also test the requires clause and parameter constraints to check that SFINAE works correctly? | |
23 | Nit: we normally use a trailing underscore for private variables. How about renaming it (maybe to something like original, original_input, etc.)? | |
23 | In the signature, T1 and T2 can be different types, but the current tests only cover the case when they are the same type. Can you also test the conversion? | |
26 | Nit: decltype(auto). | |
27 | Nit: the formatting looks a little weird here, perhaps align oldval and newval with Iter on the line above? | |
44 | Optional: consider adding comments to imitate named arguments, something like: test<Iter, Sent, 4>(/*input=*/{1, 2, 3, 4}, /*old=*/2, /*new=*/23, /*expected=*/{1, 23, 3, 4}); | |
46 | Can this argument be deduced? (in all cases except for 0, I guess) | |
55 | Can you also add a test for when the range overload returns dangling? | |
82 | A couple more tests that I think should be added:
| |
libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace_if.pass.cpp | ||
23 | I think all the same comments as in ranges.replace.pass.cpp apply here. |
The implementation looks great. Just need to add a few test cases and update the synopsis. Thanks!
Please don't forget to update this with an actual link.