Created on 2017-03-11.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4659.
Insert a paragraph after [unique.ptr.single.ctor] p11:
unique_ptr(pointer p, see below d1) noexcept; unique_ptr(pointer p, see below d2) noexcept;-9- The signature of these constructors depends upon whether D is a reference type. If D is a non-reference type A, then the signatures are:
[…] -10- If D is an lvalue reference type A&, then the signatures are: […] -11- If D is an lvalue reference type const A&, then the signatures are: […] -??- Requires: For the first constructor, if D is not a reference type, D shall satisfy the requirements of CopyConstructible and such construction shall not exit via an exception. For the second constructor, if D is not a reference type, D shall satisfy the requirements of MoveConstructible and such construction shall not exit via an exception.
[ 2017-07 Toronto Wed Issue Prioritization ]
Priority 0; Move to Ready
[ 2017-05-03, Tim comments ]
The suggested wording has been moved to the PR section now that the new working draft is available.
[ 2017-03-16, Daniel comments ]
The publication of the new working draft is awaited, before proposed wording against that new working draft is formally possible.
The wording simplification in LWG 2905 accidentally deleted the requirement that construction of the deleter doesn't throw an exception. While this isn't the end of the world since any exception will just run into the noexcept on the constructor and result in a call to std::terminate(), the other unique_ptr constructors still have a similar no-exception Requires: clause, leaving us in the odd situation where throwing an exception results in undefined behavior for some constructors and terminate() for others. If guaranteeing std::terminate() on exception is desirable, that should be done across the board.
The proposed wording below simply restores the nothrow requirement along with the Copy/MoveConstructible requirement. Wording for the other alternative (guaranteed std::terminate()) can be produced if desired.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-11-13 19:01:36 | admin | set | status: voting -> wp |
2017-10-17 18:34:55 | admin | set | status: ready -> voting |
2017-07-15 22:58:07 | admin | set | messages: + msg9374 |
2017-07-15 22:58:07 | admin | set | status: new -> ready |
2017-05-03 20:57:43 | admin | set | messages: + msg9169 |
2017-05-03 20:57:43 | admin | set | messages: + msg9168 |
2017-03-16 20:15:06 | admin | set | messages: + msg9129 |
2017-03-11 00:00:00 | admin | create |