Add ranges::in_fun_result
Details
- Reviewers
• Quuxplusone Mordante var-const - Group Reviewers
Restricted Project - Commits
- rG1e77b396ffe4: [libc++] Add ranges::in_fun_result
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/CMakeLists.txt | ||
---|---|---|
33 | Here and modulemap, please alphabetize. | |
libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp | ||
21–27 | Could this plausibly use the MoveOnly type from test/support/moveonly.h instead, just to reduce the line count a bit? | |
libcxx/test/std/algorithms/algorithms.results/no_unqiue_address.compile.pass.cpp | ||
1 ↗ | (On Diff #398743) | Please fix the spelling of this file's filename, at some point (here or elsewhere or just as an NFC commit). |
libcxx/include/algorithm | ||
---|---|---|
26 | in_out_result isn't listed here; and in_in_out_result either isn't listed, or merge-conflicts. | |
libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp | ||
32 | Same as on the in_in_out review, I think A would benefit from a comment about // no implicit conversion, and B could just be B(int); |
libcxx/include/__algorithm/in_fun_result.h | ||
---|---|---|
17 | Does this file need the #pragma GCC system_header annotation? | |
23 | Note: in in_out_result, I used more descriptive/verbose names like _InputIterator. Ideally these should be consistent. I think that having long names is more common in __algorithm/ (quick grepping shows ~360 hits for _InputIterator and 0 hits for _Ip in my current working copy). | |
30 | _LIBCPP_HIDE_FROM_ABI? | |
libcxx/include/algorithm | ||
26 | in_out_result is at the bottom of synopsis (around line 655). I don't have a very strong opinion on where in the synopsis these should be listed, but they should all be together; I'd slightly prefer having them in the end because I feel that these are helper types that don't really need to be in the spotlight. | |
libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp | ||
81 | Please add return 0;. | |
libcxx/test/std/algorithms/algorithms.results/no_unique_address.compile.pass.cpp | ||
21 | Can you please move the corresponding tests in in_out_result.compile.pass.cpp to this file for consistency? (not necessarily in this patch) | |
28 | Would it be worthwhile to also test for the case of Empty and Empty2 where both classes are empty but they are distinct types? |
libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp | ||
---|---|---|
23–29 | Optional: maybe move definitions of ConstructibleFrom and Empty down so that they're right above test() definition and thus closer to the point of usage? | |
61 | Optional: consider adding a brief comment to each test case, e.g. Conversion via copy construction and Conversion via casting (also tests that move-only types can be converted). | |
70 | Perhaps also test with a copy-only type? (that could be overkill) | |
72 | Ultranit: please include <utility>. |
- Use MoveOnyl.h
- Add constexpr test
- Add generated file
- Address comments
- Address comments
libcxx/include/algorithm | ||
---|---|---|
26 | @philnik thanks for moving in_out_result up! :) | |
libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp | ||
73 | s/10L/10/, right? | |
libcxx/test/std/algorithms/algorithms.results/no_unique_address.compile.pass.cpp | ||
21 | This was marked "Done", but not done. Since you moved the synopsis comment for in_out_result, I think it would be nice to also move the mentioned tests in this same commit. But if it happens in a followup, also cool. |
libcxx/test/std/algorithms/algorithms.results/no_unique_address.compile.pass.cpp | ||
---|---|---|
21 | I'll do it in the results cleanup PR. The synopsis are just to easy to miss for my taste, so I moved them here. |
Here and modulemap, please alphabetize.
Good news: I'll render this nit unnecessary Real Soon Now via however D116958 ends up.