non-const copy ctor

John Love-Jensen
Sat Apr 8 00:39:00 GMT 2006

Hi Christian,

The construct you are using requires a const copy ctor.

> I think this is similar to what std::auto_ptr does. It also has a non-const
> copy constructor. But I also noticed some strange auto_ptr_ref-stuff there
> which I never understood.

Yes, that's what the auto_ptr_ref stuff does.

> Maybe that's working around this problem.

It's not a problem, per se.  It's intentional, by design.

> btw: I was doing exactly that on a windows machine with Visual Studio
> 7.something without any problems.

In that VC7 was not compliant with the C++ standard on this issue is not
particularly surprising.

VC8 is much better regarding compliance to the C++ standard.  I don't know
if it is compliant on this particular issue or not.


More information about the Gcc-help mailing list