This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [c++0x] unique_ptr
PAOLO.CARLINI@ORACLE.COM escreveu:
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
members:
// 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 20.6.12.2, paragraph 1
(class definition), and not explicit in 20.6.12.2.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.
Regards,
rod