Title
auto_ptr characteristics
Status
nad editorial
Section
[auto.ptr]
Submitter
Maarten Hilferink

Created on 2009-01-21.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [auto.ptr], paragraph 3:

The auto_ptr provides a semantics of strict ownership. An auto_ptr owns the ob ject it holds a pointer to. Copying an auto_ptr copies the pointer and transfers ownership to the destination. If more than one auto_ptr owns the same ob ject at the same time the behavior of the program is undefined. [Note: The uses of auto_ptr include providing temporary exception-safety for dynamically allocated memory, passing ownership of dynamically allocated memory to a function, and returning dynamically allocated memory from a function. auto_ptr does not meet the CopyConstructible and Assignable requirements for standard library container elements and thus instantiating a standard library container with an auto_ptr results in undefined behavior.

Instances of auto_ptr shall meet the MoveConstructible and MoveAssignable requirements, but do not meet the CopyConstructible and CopyAssignable requirements. -- end note]

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We agree with the intent of the proposed resolution. Move to NAD Editorial.

Date: 2009-01-21.00:00:00

I think that the Note of [auto.ptr], paragraph 3 needs a rewrite since "Assignable" is no longer defined as a concept. The relationship of auto_ptr with the new CopyAssignable, MoveAssignable, and MoveConstructible concepts should be clarified. Furthermore, since the use of auto_ptr is depreciated anyway, we can also omit a description of its intended use.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg4629
2010-10-21 18:28:33adminsetmessages: + msg4628
2009-01-21 00:00:00admincreate