[libcxx-commits] [PATCH] D103487: [libcxx][ranges] Add `default_sentinel` and `default_sentinel_t`.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 1 13:26:14 PDT 2021
Quuxplusone accepted this revision as: Quuxplusone.
Quuxplusone added a comment.
LGTM % that one additional test.
================
Comment at: libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp:16
+
+#include <iterator>
+
----------------
```
#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?
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.
================
Comment at: libcxx/test/std/iterators/predef.iterators/default.sentinel/default.sentinel.pass.cpp:24
+
+ static_assert(std::same_as<decltype(std::default_sentinel), const std::default_sentinel_t>);
+
----------------
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.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103487/new/
https://reviews.llvm.org/D103487
More information about the libcxx-commits
mailing list