This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: auto_ptr error is rather confusing
- To: "Anthony Heading" <aheading at jpmorgan dot com>,<gcc at gcc dot gnu dot org>
- Subject: Re: auto_ptr error is rather confusing
- From: "Artem Khodush" <kaa at comail dot ru>
- Date: Thu, 10 Aug 2000 00:56:00 +0400
- Organization: -
- References: <20000808171715.A5831@tkd-fires-01.ja.jpmorgan.com>
- Reply-To: "Artem Khodush" <kaa at comail dot ru>
Anthony Heading wrote:
> The following doesn't appear to compile using either 2.95.2 or
> CodeSourcery's splendid web snapshot machine (though the
> diagnostics are very different).
>
-snip-
> #include <memory>
> int main()
> {
> std::auto_ptr<int> x;
> x = std::auto_ptr<int>(new int);
> return 0;
> }
>
This code compiles with current gcc (2.96) configured with --enable-libstdcxx-v3,
because in the new c++ library, the following assignement operator was added to
the auto_ptr class
auto_ptr& operator=(auto_ptr_ref<X> r) throw();
This is not in the current standard, but is in accordance with proposed resolution to
the library defect report #127
(see http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#127).
Best regards,
Artem.