Created on 2009-04-25.00:00:00 last changed 171 months ago
Proposed resolution:
Add to [unique.ptr.single]:
template <class T, class D> class unique_ptr { public: template <class U> unique_ptr(auto_ptr<U>& u); template <class U> unique_ptr(auto_ptr<U>&& u); };
Add to [unique.ptr.single.ctor]:
template <class U> unique_ptr(auto_ptr<U>& u); template <class U> unique_ptr(auto_ptr<U>&& u);Effects: Constructs a unique_ptr with u.release().
Postconditions: get() == the value u.get() had before the construciton, modulo any required offset adjustments resulting from the cast from U* to T*. u.get() == nullptr.
Throws: nothing.
Remarks: U* shall be implicitly convertible to T* and D shall be the same type as default_delete<T>, else these constructors shall not participate in overload resolution.
Rationale:
Solved by N3073.
[ 2010-03-14 Howard adds: ]
We moved N3073 to the formal motions page in Pittsburgh which should obsolete this issue. I've moved this issue to NAD Editorial, solved by N3073.
[ 2009-10 Santa Cruz: ]
Move to Ready.
[ 2009-08-01 Howard deconceptifies wording: ]
I also moved the change from [depr.auto.ptr] to [unique.ptr.single] per the Editor's request in Batavia (as long as I was making changes anyway). Set back to Review.
[ 2009-07 Frankfurt ]
Moved from Tentatively Ready to Open only because the wording needs to be tweaked for concepts removal.
[ Batavia (2009-05): ]
Pete believes it not a good idea to separate parts of a class's definition. Therefore, if we do this, it should be part of unique-ptr's specification.
Alisdair believes the lvalue overload may be not necessary.
Marc believes it is more than just sugar, as it does ease the transition to unique-ptr.
We agree with the resolution as presented. Move to Tentatively Ready.
Message c++std-lib-23182 led to a discussion in which several people expressed interest in being able to convert an auto_ptr to a unique_ptr without the need to call release. Below is wording to accomplish this.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-11-19 19:04:45 | admin | set | status: nad editorial -> resolved |
2010-10-21 18:28:33 | admin | set | messages: + msg727 |
2010-10-21 18:28:33 | admin | set | messages: + msg726 |
2010-10-21 18:28:33 | admin | set | messages: + msg725 |
2010-10-21 18:28:33 | admin | set | messages: + msg724 |
2010-10-21 18:28:33 | admin | set | messages: + msg723 |
2010-10-21 18:28:33 | admin | set | messages: + msg722 |
2010-10-21 18:28:33 | admin | set | messages: + msg721 |
2009-04-25 00:00:00 | admin | create |