Details
- Reviewers
ldionne Mordante var-const - Group Reviewers
Restricted Project - Commits
- rG4098e2085d29: [libc++] Add test for algorithm result type alias declarations
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp | ||
---|---|---|
9 | You probably need to add UNSUPPORTED. | |
18 | Optional nit: any reason not to use same_as? | |
21 | Do we also need to test that the corresponding algorithm returns the right type? static_assert(std::is_same_v<in_in_result<int, long>, mismatch_result<int, long>>); static_assert(std::is_same_v<decltype(std::ranges::mismatch(i1, s1, i2, s2)), in_in_result<int, long>>); |
libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp | ||
---|---|---|
21 | Although to be fair, we do that already in the algorithm test files, so this would be duplicative. |
- Address comments
libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp | ||
---|---|---|
18 | is_same reads more naturally to me, but I think nothing about either of them is objectively better than the other one. Using same_as might be marginally more expensive for the compiler, but who knows (or cares). | |
21 | Exactly. This test only exists to ensure that the aliases exist. There are probably a few tests where we don't actually check that, since is_in_result<int, long> and swap_ranges_result<int, long> are indistinguishable from each other. |
You probably need to add UNSUPPORTED.