[libcxx-commits] [libcxx] [libc++] Add an ABI setting to harden unique_ptr<T[]>::operator[] (PR #91798)
Konstantin Varlamov via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Oct 5 19:11:14 PDT 2024
================
@@ -411,11 +518,13 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr(unique_ptr&& __u) _NOEXCEPT
: __ptr_(__u.release()),
- __deleter_(std::forward<deleter_type>(__u.get_deleter())) {}
+ __deleter_(std::forward<deleter_type>(__u.get_deleter())),
+ __checker_(std::move(__u.__checker_)) {}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
reset(__u.release());
__deleter_ = std::forward<deleter_type>(__u.get_deleter());
+ __checker_ = std::move(std::move(__u.__checker_));
----------------
var-const wrote:
What's the purpose of doing a double move here? Is it a typo, perhaps?
https://github.com/llvm/llvm-project/pull/91798
More information about the libcxx-commits
mailing list