unique_ptr
assignment effects w.r.t. deleterSection: 20.3.1.3.4 [unique.ptr.single.asgn] Status: C++14 Submitter: Jonathan Wakely Opened: 2013-03-13 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [unique.ptr.single.asgn].
View all issues with C++14 status.
Discussion:
The Effects clauses for unique_ptr
assignment don't make sense, what
is the target of "an assignment from std::forward<D>(u.get_deleter())
"?
[2013-04-20, Bristol]
Move to Ready
[2013-09-29, Chicago]
Apply to Working Paper
Proposed resolution:
This wording is relative to N3485.
Edit 20.3.1.3.4 [unique.ptr.single.asgn] paragraph 2:
unique_ptr& operator=(unique_ptr&& u) noexcept;[…]
-2- Effects: Transfers ownership fromu
to*this
as if by callingreset(u.release())
followed byan assignment fromget_deleter() = std::forward<D>(u.get_deleter())
.
Edit 20.3.1.3.4 [unique.ptr.single.asgn] paragraph 6:
template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;[…]
-6- Effects: Transfers ownership fromu
to*this
as if by callingreset(u.release())
followed byan assignment fromget_deleter() = std::forward<E>(u.get_deleter())
.