[libcxx-commits] [PATCH] D103487: [libcxx][ranges] Add `default_sentinel` and `default_sentinel_t`.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 1 13:40:25 PDT 2021


zoecarver added inline comments.


================
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>);
+
----------------
Quuxplusone wrote:
> 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.)
Doesn't semiregular check that? Or is this a default constructible vs default initializable thing? 


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