[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
Mon Jan 31 11:10:14 PST 2022


Mordante accepted this revision as: Mordante.
Mordante added a comment.

LGTM with one minor 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);
+  }
----------------
Quuxplusone wrote:
> Mordante wrote:
> > Use after move of `r`, likewise in the two blocks below.
> Since this copies the sentinel even when `r` is an rvalue, I think it's OK — might even be a test-coverage benefit!
> Or I guess rather: Since `std::get<0>(std::move(r))` isn't supposed to touch the sentinel member of `r`, (etc.)
Please add a comment why this is safe


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

https://reviews.llvm.org/D117961



More information about the libcxx-commits mailing list