[libcxx-commits] [PATCH] D66262: Constrain tuple/unique_ptr move constructors (2899)
Marshall Clow via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 12 08:37:56 PDT 2019
mclow.lists added inline comments.
================
Comment at: libcxx/include/memory:2555
unique_ptr& operator=(unique_ptr const&) = delete;
-#endif
-
----------------
Ok, this is just weird. Everywhere else in libc++, we avoid using `= delete` in C++03 mode, because it's not a thing.
We even have a macro for it in `__config`:
```
#ifdef _LIBCPP_CXX03_LANG
# define _LIBCPP_EQUAL_DELETE
#else
# define _LIBCPP_EQUAL_DELETE = delete
#endif
```
And yet, here (twice!) we only do this for C++03.
@EricWF added this in https://llvm.org/r364161; so I think he should explain.
================
Comment at: libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp:103
+typedef std::unique_ptr<int, NonMoveableDeleter<int> > NonMoveableUniquePtr;
+static_assert(!std::is_assignable<NonMoveableUniquePtr, NonMoveableUniquePtr&&>::value, "");
+
----------------
We have a type trait for `move_assignable`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66262/new/
https://reviews.llvm.org/D66262
More information about the libcxx-commits
mailing list