
7 Dec
2005
7 Dec
'05
3:01 p.m.
Hi. There's a shared_ptr constructor that accepts an auto_ptr<Y>&. Shouldn't it accept auto_ptr<Y> by value rather by non-const reference? It seems to me that the reference does not add anything, but only causes a VC warning (level 4): --- warning C4239: nonstandard extension used : 'argument' : conversion from 'std::auto_ptr<_Ty>' to 'std::auto_ptr<_Ty> &' A reference that is not to 'const' cannot be bound to a non-lvalue --- when calling this constructor with a temporary auto_ptr. This warning is a good thing and I don't want to disable it. Thanks, Yuval