Created on 2011-04-16.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to the FDIS.
Edit [unique.ptr.single.asgn] p. 6 as indicated:
template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;4 - Requires: If E is not a reference type, assignment of the deleter from an rvalue of type E shall be well-formed and shall not throw an exception. Otherwise, E is a reference type and assignment of the deleter from an lvalue of type E shall be well-formed and shall not throw an exception.
5 - Remarks: This operator shall not participate in overload resolution unless:
- unique_ptr<U, E>::pointer is implicitly convertible to pointer and
- U is not an array type.
6 - Effects: Transfers ownership from u to *this as if by calling reset(u.release()) followed by an assignment from std::forward<
7 - Returns: *this.DE>(u.get_deleter()).
[ Bloomington, 2011 ]
Move to Ready
The semantics described in [unique.ptr.single.asgn] p. 6
Effects: Transfers ownership from u to *this as if […] followed by an assignment from std::forward<D>(u.get_deleter()).
contradicts to the pre-conditions described in p. 4:
Requires: If E is not a reference type, assignment of the deleter from an rvalue of type E shall be well-formed and shall not throw an exception. Otherwise, E is a reference type and assignment of the deleter from an lvalue of type E shall be well-formed and shall not throw an exception.
Either the pre-conditions are incorrect or the semantics should be an assignment from std::forward<E>(u.get_deleter()), instead.
It turns out that this contradiction is due to an incorrect transcription from the proposed resolution of 983 to the finally accepted proposal n3073 (see bullet 12) as confirmed by Howard Hinnant, thus the type argument provided to std::forward must be fixed as indicated.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2012-02-12 18:36:43 | admin | set | status: voting -> wp |
2012-02-09 04:07:48 | admin | set | status: ready -> voting |
2011-08-16 10:45:53 | admin | set | messages: + msg5837 |
2011-08-16 10:45:53 | admin | set | status: new -> ready |
2011-04-20 19:54:50 | admin | set | messages: + msg5723 |
2011-04-16 00:00:00 | admin | create |