Re: temporary auto_ptr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dima,

> At least I don't see any options for multiple implicit conversion here. It
seems to be one and single.

I see three implicit conversions.

std::auto_ptr<const A>::auto_ptr(std::auto_ptr_ref<const A>)
 ... via the operator cast
std::auto_ptr<const A>::auto_ptr(std::auto_ptr<const A>&)
 ... by template constructor
std::auto_ptr<const A>::auto_ptr(std::auto_ptr<const A>&)
 ... by copy constructor

The "perfect match" would be...
std::auto_ptr<const A>::auto_ptr(std::auto_ptr<const A>)
 ... but that does not exist.

> I don't see neither multiple paths to do the conversion,nor sequence of
conversions that require more than one cast.

See above.

The real issue is that a std::auto_ptr<const B> is *NOT* a
std::auto_ptr<const A>, since std::auto_ptr<const B> is *NOT* derived from
std::auto_ptr<const A>.  The former is not interchangeable with the latter.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux