[libcxx-commits] [PATCH] D62454: SFINAE on pair/tuple assignment operators 2729

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 30 11:31:45 PDT 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: test/std/utilities/utility/pairs/pairs.pair/assign_pair.pass.cpp:76
+        using P = std::pair<int, NonCopyAssignable>;
+        static_assert(!std::is_move_assignable<P>::value, "");
     }
----------------
Why don't you keep the old check for `static_assert(!std::is_copy_assignable<P>::value, "");` too?


================
Comment at: test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp:25
+struct NonMoveAssignable {
+  NonMoveAssignable& operator=(NonMoveAssignable&&) = delete;
 };
----------------
You should be able to add this to make it copy-assignable:

```
NonMoveAssignable& operator=(NonMoveAssignable const&) = default;
```



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

https://reviews.llvm.org/D62454





More information about the libcxx-commits mailing list