[libcxx-commits] [PATCH] D99873: [libcxx] adds `std::ranges::iter_move` and `std::iter_rvalue_reference_t`

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 15 21:23:20 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/include/concepts:455
+template<class _Tp>
+concept __rvalue_reference = __core_reference<_Tp> && !__lvalue_reference<_Tp>;
+
----------------
zoecarver wrote:
> Same as above but for rvalue reference. Then we could get rid of `__core_reference`.
Subsumption means that we need to have all three if we plan to use both `__lvalue_reference` and `__rvalue_reference` (see `integral`, `signed_integral`, and `unsigned_integral`). I can technically get away with just introducing `__lvalue_reference`, but I'd rather hedge that `__rvalue_reference` will be necessary down the line and get it right on the first go.


================
Comment at: libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp:186
+  static_assert(check_iter_move());
+  assert(check_iter_move());
+
----------------
zoecarver wrote:
> No need to call assert here. 
Don't we want to check the run-time value as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99873



More information about the libcxx-commits mailing list