stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: auto_ptr behaviour
Date Mon, 29 Jan 2007 18:54:02 GMT
Muller wrote:
> Hi, team!
> It seems like auto_ptr takes its constructor argument assuming it a
> auto_ptr_ref (argument is a raw pointer in fact).

The standard requires implementations to provide the three auto_ptr
ctors below. AFAICS, those are exactly the ones we define:

     explicit auto_ptr(X* p =0) throw();
     auto_ptr(auto_ptr&) throw();
     template<class Y> auto_ptr(auto_ptr<Y>&) throw();

> VC71 compiler produces an
> error. The workaround found so far (to calm down the compiler) is simply
> commenting the troublesome constructor or modifying its argument with a
> reference sign.

We'd need to see a test case to determine whether we're dealing
with a bug in stdcxx, the compiler, or perhaps even your code :)
Auto_ptr is a tricky beast and some compilers have trouble with
it. From our nightly test results it looks like MSVC 7.1 might
be one of them since it fails to compile the

MSVC 8.0, OTOH, compiles and runs just fine:

That said, if this usage is important to you I suggest you open
a bug report in Jira (and include a test case). We might be able
to come up with a workaround for MSVC 7.1.


View raw message