Details
- Reviewers
ldionne cjdb • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG065cf3f9d703: [libcxx][ranges] Add `default_sentinel` and `default_sentinel_t`.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM % that one additional test.
libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp | ||
---|---|---|
17 | #include <concepts> #include <type_traits> Actually, if you replaced same_as with is_same_v and semiregular with is_copy_constructible_v, could you remove the UNSUPPORTED: libcpp-no-concepts line so that this would be testable in more situations? | |
25 | I'd also like to see here that std::default_sentinel_t s1; auto s2 = std::default_sentinel_t{}; (void)s1; (void)s2; both compile. (C++20 seems to require that these compile. Unlike some types, e.g. std::nullopt_t, which are not supposed to default-construct.) |
libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp | ||
---|---|---|
25 | Doesn't semiregular check that? Or is this a default constructible vs default initializable thing? |
libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp | ||
---|---|---|
25 | If we don't know, that's a great reason to add the test. :) |
LGTM post commit.
libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp | ||
---|---|---|
17 | FWIW, libcpp-no-concepts is something that will die eventually as we move to newer compilers. IMO there's little benefit in doing any work to improve the situation on compilers that do not support concepts. |
Actually, if you replaced same_as with is_same_v and semiregular with is_copy_constructible_v, could you remove the UNSUPPORTED: libcpp-no-concepts line so that this would be testable in more situations?
If de-concept-ifying this test turns into a rabbit hole, then never mind; but if it's trivial to simplify, then it'd be nice.