[libcxx-commits] [PATCH] D102135: [libcxx][ranges] adds _`copyable-box`_
Tim Song via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 1 12:41:37 PDT 2021
tcanens added inline comments.
================
Comment at: libcxx/include/__ranges/copyable_box.h:111
+ class __copyable_box<_Tp> {
+ [[no_unique_address]] _Tp __val_;
+
----------------
zoecarver wrote:
> What do you think about this problem: https://reviews.llvm.org/D103056#inline-999709
>
> Basically, if we have two copyable-box members that are both `no_unique_address` where T is copyable and empty, we will never invoke the copy constructor on assignment. I think this is probably a bug with copyable box, and not its users.
`no_unique_address` doesn't change the basic object model rule that two living objects of the same type must have distinct addresses.
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