Details
- Reviewers
ldionne cjdb • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG4ac87e33785e: [libcxx][ranges] Add `unreachable_sentinel`.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM % nits.
| libcxx/include/iterator | ||
|---|---|---|
| 406–409 | Swap this down to below [iterators.counted], to match https://eel.is/c++draft/iterator.synopsis | |
| libcxx/test/std/iterators/predef.iterators/unreachable.sentinel/unreachable_sentinel.pass.cpp | ||
| 30–38 | I'd test both normal and reversed comparisons, and equality and inequality, and at least one trivial SFINAE-friendliness test and noexceptness test. I.e. I'd replace this with some variation on constexpr bool test() {
auto sentinel = std::unreachable_sentinel;
int i = 42;
assert(i != sentinel);
assert(sentinel != i);
assert(!(i == sentinel));
assert(!(sentinel == i));
assert(&i != sentinel);
assert(sentinel != &i);
assert(!(&i == sentinel));
assert(!(sentinel == &i));
int *p = nullptr;
assert(p != sentinel);
assert(sentinel != p);
assert(!(p == sentinel));
assert(!(sentinel == p));
assert( std::equality_comparable_with<std::unreachable_sentinel_t, int>);
assert( std::equality_comparable_with<std::unreachable_sentinel_t, int*>);
assert(!std::equality_comparable_with<std::unreachable_sentinel_t, void*>);
ASSERT_NOEXCEPT(sentinel == p);
ASSERT_NOEXCEPT(sentinel != p);
return true;
}and remember to do the usual test(); static_assert(test()); dance. | |
LGTM but please implement Arthur's comments, I agree with everything. Also, is there something that needs updating in the paper status?
I don't need to see this again.
Also, is there something that needs updating in the paper status?
I can't find anything.
Thanks for the reviews everyone. Thanks for the tests Arthur.
Swap this down to below [iterators.counted], to match https://eel.is/c++draft/iterator.synopsis