[libcxx-commits] [PATCH] D102434: [libcxx][ranges] adds concept `sized_range` and cleans up `ranges::size`

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 13 16:54:08 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/ranges/range.req/range.sized/sized_range.compile.pass.cpp:23
+static_assert(stdr::sized_range<int[5]>);
+static_assert(stdr::sized_range<int (&)[5]>);
+static_assert(!stdr::sized_range<int (&)[]>);
----------------
cjdb wrote:
> zoecarver wrote:
> > Rvalue array?
> That's `int[5]`.
I assume Zoe was asking for xvalue (rvalue-reference) to array: `int (&&)[5]` and `int (&&)[]`.


================
Comment at: libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp:31
 static_assert(stdr::random_access_range<std::string_view const>);
 static_assert(!stdr::view<std::string_view const>);
+static_assert(stdr::sized_range<std::string_view const>);
----------------
Unrelated to this PR, but it strikes me as odd that `string_view` is //not// a `std::ranges::view`.
Should you perhaps be asserting `stdr::view<std::string_view&>` instead?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102434/new/

https://reviews.llvm.org/D102434



More information about the libcxx-commits mailing list