[libcxx-commits] [PATCH] D101476: [libcxx][ranges] Add ranges::data CPO.

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 28 20:46:22 PDT 2021


cjdb requested changes to this revision.
cjdb added a comment.
This revision now requires changes to proceed.

Please also add checks for the noexcept specifiers.



================
Comment at: libcxx/include/__ranges/data.h:34-38
+  template <class _Tp>
+  concept __borrowing_enabled = enable_borrowed_range<remove_cvref_t<_Tp>>;
+
+  template <class _Tp>
+  concept __not_invalid_rvalue = __borrowing_enabled<_Tp> || !is_rvalue_reference_v<_Tp>;
----------------
Isn't this `__can_borrow` from D100255?


================
Comment at: libcxx/include/__ranges/data.h:56
+  template <class _Tp>
+  concept __unqualified_begin =
+    __not_incomplete_array<_Tp> &&
----------------
I think this is missing `!__member_data<_Tp>`. This suggests a test where `r.data()` and `ranges::begin(r)` are both valid needs to be added.

I'm also unsure as to why it's called `__unqualified_begin`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101476



More information about the libcxx-commits mailing list