[libcxx-commits] [libcxx] [libc++] P2770R0: "Stashing stashing iterators for proper flattening" (PR #66033)

Jakub Mazurkiewicz via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 27 13:31:40 PST 2023


================
@@ -43,16 +42,14 @@ constexpr bool test() {
   }
 
   {
-    // !equality_comparable<iterator_t<Base>>
+    // !forward_range<iterator_t<Base>>
     using Inner = BufferView<int*>;
     using Outer = BufferView<cpp20_input_iterator<Inner*>, sentinel_wrapper<cpp20_input_iterator<Inner*>>>;
     static_assert(!std::equality_comparable<std::ranges::iterator_t<Outer>>);
     Inner inners[2] = {buffer[0], buffer[1]};
     std::ranges::join_view jv(Outer{inners});
     auto iter = jv.begin();
     static_assert(!std::equality_comparable<decltype(iter)>);
-    auto const_iter = std::as_const(jv).begin();
----------------
JMazurkiewicz wrote:

This is not valid anymore, because `jv` adapts input range (of type `Outer`) and, since P2770R0, `begin() const` requires forward range.

https://github.com/llvm/llvm-project/pull/66033


More information about the libcxx-commits mailing list