stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
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 20.auto.ptr.cpp
test:
http://people.apache.org/~sebor/stdcxx/results/Windows_2000-msvc-7.1-11s-log.gz.txt
http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/tests/utilities/20.auto.ptr.cpp

MSVC 8.0, OTOH, compiles and runs 20.auto.ptr.cpp just fine:
http://people.apache.org/~sebor/stdcxx/results/windows-2003-msvc-32b-8.0-15s-log.gz.txt

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.

Martin

Mime
View raw message