Created on 2008-06-18.00:00:00 last changed 162 months ago
Proposed resolution:
Add after [unique.ptr.dltr.dflt], p1:
template <class U> default_delete(const default_delete<U>& other);-1- Effects: ...
Remarks: This constructor shall participate in overload resolution if and only if U* is implicitly convertible to T*.
[ 2009-10 Santa Cruz: ]
Move to Ready.
[ 2009-07-26 Howard provided rewritten proposed wording and moved to Review. ]
[ 2009-07 Frankfurt: ]
The proposed resolution uses concepts. Howard needs to rewrite the proposed resolution.
Move back to Open.
[ Batavia (2009-05): ]
Keep in Review status for the reasons cited.
[ Post Summit: ]
Alisdair: This issue has to stay in review pending a paper constraining unique_ptr.
Consensus: We agree with the resolution, but unique_ptr needs to be constrained, too.
Recommend Keep in Review.
[ Howard adds 2008-11-26: ]
I believe we need to be careful to not outlaw the following use case, and I believe the current proposed wording (requires Convertible<U*, T*> && HasVirtualDestructor<T>) does so:
#include <memory> int main() { std::unique_ptr<int> p1(new int(1)); std::unique_ptr<const int> p2(move(p1)); int i = *p2; // *p2 = i; // should not compile }
I've removed "&& HasVirtualDestructor<T>" from the requires clause in the proposed wording.
No relationship between U and T in the converting constructor for default_delete template.
Requirements: U* is convertible to T* and has_virtual_destructor<T>; the latter should also become a concept.
Rules out cross-casting.
The requirements for unique_ptr conversions should be the same as those on the deleter.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg4065 |
2010-10-21 18:28:33 | admin | set | messages: + msg4064 |
2010-10-21 18:28:33 | admin | set | messages: + msg4063 |
2010-10-21 18:28:33 | admin | set | messages: + msg4062 |
2010-10-21 18:28:33 | admin | set | messages: + msg4061 |
2010-10-21 18:28:33 | admin | set | messages: + msg4060 |
2010-10-21 18:28:33 | admin | set | messages: + msg4059 |
2008-06-18 00:00:00 | admin | create |