[libcxx-commits] [PATCH] D131495: [libc++] implement "pair" section of P2321R2 `zip`

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 24 13:08:42 PDT 2022


huixie90 added inline comments.


================
Comment at: libcxx/test/std/utilities/utility/pairs/pairs.pair/swap_member_const.pass.cpp:41
+struct ConstSwappable {
+  mutable int i;
+  friend constexpr void swap(const ConstSwappable& lhs, const ConstSwappable& rhs) { std::swap(lhs.i, rhs.i); }
----------------
var-const wrote:
> Optional: instead of using `mutable,` you could store a pointer or a reference, then modify the pointed-to value. That should fix the GCC issue.
I think it might be better to have a test to test this value semantics type, since we have a test that tests pair of references for the reference semantics already. what do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131495



More information about the libcxx-commits mailing list