This is the mail archive of the
mailing list for the libstdc++ project.
Re: [c++0x] unique_ptr
In the meanwhile I dig out some old emails, and indeed, I think the paperworks is cleared, great! Therefore, Chris, do you mean to revamp you implementation and officially submit it in the standard patch form? Or do we want to proceed differently? Pleas let me know as soon as possible.
That's great, thanks for checking. I'd just want to remember that
shared_ptr implementation should be changed to, adding the following
// shared_ptr ctors
template <class Y, class D> shared_ptr(const unique_ptr<Y, D>& r) = delete.
template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);
// shared_ptr assignment
template <class Y, class D> shared_ptr& operator=(const unique_ptr<Y,
D>& r) = delete;
template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r);
The '= delete' specifier should obviously be ommited (since I think it's
not supported in latest gcc) and instead the declaration should be private.
In my copy of the c++0x draft (doc #N2588) there's an inconsistency,
where the constructors are declared explicit in 18.104.22.168, paragraph 1
(class definition), and not explicit in 22.214.171.124.1. paragraph 37. IMHO
this should be 'implicit' to avoid excess typing and mimick the ctor
from an auto_ptr.
Sorry if this has been already dealt with.