[libcxx-commits] [PATCH] D117961: [libc++] Fix LWG3589 "The const lvalue reference overload of get for subrange..."

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 23 05:01:06 PST 2022


Mordante added inline comments.


================
Comment at: libcxx/include/__ranges/subrange.h:228
   template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
-    requires (_Index < 2)
+    requires (_Index == 0 && copyable<_Iter>) || (_Index == 1)
   _LIBCPP_HIDE_FROM_ABI
----------------
I don't mind `(_Index == 1)`, but the current code doesn't match the LWG issue.


================
Comment at: libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp:49
+    assert(base(std::get<0>(std::move(r))) == a);
+    assert(base(base(std::get<1>(std::move(r)))) == a + 3);
+  }
----------------
Use after move of `r`, likewise in the two blocks below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117961



More information about the libcxx-commits mailing list