Title
Allow nullptr_t assignments to unique_ptr
Status
c++11
Section
[unique.ptr.single.asgn]
Submitter
Alisdair Meredith

Created on 2009-03-11.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the synopsis in [unique.ptr.single]:

unique_ptr& operator=(unspecified-pointer-type nullptr_t);

Change [unique.ptr.single.asgn]:

unique_ptr& operator=(unspecified-pointer-type nullptr_t);

Assigns from the literal 0 or NULL. [Note: The unspecified-pointer-type is often implemented as a pointer to a private data member, avoiding many of the implicit conversion pitfalls. — end note]

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to Tentatively Ready.

Date: 2012-10-21.13:19:07

Addresses UK 211 [CD1]

The nullptr_t type was introduced to resolve the null pointer literal problem. It should be used for the assignment operator, as with the constructor and elsewhere through the library.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg355
2010-10-21 18:28:33adminsetmessages: + msg354
2009-03-11 00:00:00admincreate