[libcxx-commits] [PATCH] D102135: [libcxx][ranges] adds _`copyable-box`_

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 29 15:23:07 PDT 2021


CaseyCarter added inline comments.


================
Comment at: libcxx/include/__ranges/copyable_box.h:124
+    __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default;
+    __copyable_box& operator=(__copyable_box&&) requires copyable<_Tp> = default;
+
----------------
Why not `requires movable<_Tp>`? (Don't forget to update the redundant constraint on line 135.) This enables you to relax the requirements on this specialization to `copyable<_Tp> || (is_nothrow_copy_constructible_v<_Tp> && (movable<_Tp> || is_nothrow_move_constructible_v<_Tp>))`. Not that I think there's much to be gained thereby - it's hard to envision a nothrow-copy_constructible type that isn't also nothrow-move_constructible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102135



More information about the libcxx-commits mailing list