This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with auto_prt copy-ctor under last several versions of g++.
- To: scherrey at proteus-tech dot com
- Subject: Re: Problem with auto_prt copy-ctor under last several versions of g++.
- From: Gabriel Dos_Reis <Gabriel dot Dos_Reis at sophia dot inria dot fr>
- Date: 22 Aug 1999 04:11:33 +0200
- Cc: egcs mailing list <egcs at egcs dot cygnus dot com>
- Organization: I.N.R.I.A Sophia-Antipolis (France)
- References: <37BF65A6.714FEB1A@switchco.com>
Benjamin Scherrey <scherrey@switchco.com> writes:
| This is actually a problem that's been around for a little while but I
| forgot about it until just recently when I installed 2.95.1 on my
| intel linux system. I've got some code that uses the auto_ptr type
| defined in the include file 'memory'. My code's a bit too large to be
| used as a good test case example but the issue is probably apparent to
| the g++ maintainers (or is this just an STL issue?).
|
| At line 37 of the include file 'memory' is a constructor for auto_ptr
| that takes a non-const auto_ptr&. There is no explicit copy ctor that
| takes a const auto_ptr&.
Well, this is a C++ specific issue. autor_ptr<T> is designed on
purpose to not be CopyConstructible nor Assignable; hence you can't
put it in a container and expect any reasonable behaviour.
-- Gaby