Title
shared_ptr conversion issue
Status
c++11
Section
[util.smartptr.shared.const]
Submitter
Peter Dimov

Created on 2008-08-30.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

We need to change the Requires clause of the move constructor:

shared_ptr(shared_ptr&& r); 
template<class Y> shared_ptr(shared_ptr<Y>&& r); 

Requires Remarks: For the second constructor Y* shall be convertible to T*. The second constructor shall not participate in overload resolution unless Y* is convertible to T*.

in order to actually make the example in 687 compile (it now resolves to the move constructor).

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

Moved to Ready.

This issue now represents the favored format for specifying constrained templates.

Date: 2010-10-21.18:28:33

[ San Francisco: ]

We might be able to move this to NAD, Editorial once shared_ptr is conceptualized, but we want to revisit this issue to make sure.

Date: 2008-08-30.00:00:00

We've changed shared_ptr<Y> to not convert to shared_ptr<T> when Y* doesn't convert to T* by resolving issue 687. This only fixed the converting copy constructor though. N2351 later added move support, and the converting move constructor is not constrained.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4176
2010-10-21 18:28:33adminsetmessages: + msg4175
2010-10-21 18:28:33adminsetmessages: + msg4174
2008-08-30 00:00:00admincreate