1247. auto_ptr is overspecified

Section: 99 [auto.ptr] Status: C++11 Submitter: Alisdair Meredith Opened: 2009-10-24 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [auto.ptr].

View all issues with C++11 status.

Discussion:

This issue is extracted as the ongoing point-of-interest from earlier issue 463.

auto_ptr is overspecified as the auto_ptr_ref implementation detail is formally specified, and the technique is observable so workarounds for compiler defects can cause a working implementation of the primary auto_ptr template become non-conforming.

auto_ptr_ref is a documentation aid to describe a possible mechanism to implement the class. It should be marked exposition only, as per similar classes, e.g., istreambuf_iterator::proxy

[ 2009-10-25 Daniel adds: ]

I wonder, whether the revised wording shouldn't be as straight as for istream_buf by adding one further sentence:

An implementation is permitted to provide equivalent functionality without providing a class with this name.

[ 2009-11-06 Alisdair adds Daniel's suggestion to the proposed wording. ]

[ 2009-11-06 Howard moves issue to Review. ]

[ 2009-11-14 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Proposed resolution:

Add the term "exposition only" in the following two places:

Ammend 99 [auto.ptr]p2:

The exposition only class Ttemplate auto_ptr_ref holds a reference to an auto_ptr. It is used by the auto_ptr conversions to allow auto_ptr objects to be passed to and returned from functions. An implementation is permitted to provide equivalent functionality without providing a class with this name.

namespace std {
 template <class Y> struct auto_ptr_ref { }; // exposition only