This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: temporary auto_ptr
- From: John Love-Jensen <eljay at adobe dot com>
- To: Dima Sorkin <dima dot sorkin at gmail dot com>
- Cc: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 29 Sep 2005 08:32:43 -0500
- Subject: Re: temporary auto_ptr
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