[libcxx-commits] [PATCH] D103493: [libcxx][ranges] Add concepts in range.utility.helpers.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 1 16:19:51 PDT 2021


zoecarver marked 2 inline comments as done.
zoecarver added inline comments.


================
Comment at: libcxx/test/libcxx/ranges/range.utility.helpers/has_arrow.compile.pass.cpp:77
+static_assert(std::__has_arrow<E*>);
+static_assert(!std::__has_arrow<Incomplete*>);
+static_assert(std::__has_arrow<simple_iter>);
----------------
Quuxplusone wrote:
> This surprises me, but I suppose it's because `Incomplete*` is not an input iterator, because `++it` is ill-formed, because `Incomplete` is incomplete?
Yes.


================
Comment at: libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp:29-32
+struct NoConstView : std::ranges::view_base {
+  friend int* begin(NoConstView&);
+  friend int* end(NoConstView&);
+};
----------------
Quuxplusone wrote:
> I suggest you add a positive example `OnlyConstView`, with only `friend const int* begin(const OnlyConstView&)`.
> And then you can eliminate lines 40 and 42 from `DifferentSentinel`.
This isn't a view. A view requires that T is movable (i.e., not const) and that we can do `ranges::begin(declval<T&>())`. Therefor, we need all four members.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103493



More information about the libcxx-commits mailing list