This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: error: no matching function for call to `Anton::Anton(Anton)`
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: e dot karge at struction dot de, gcc-help at gcc dot gnu dot org
- Date: Thu, 09 Oct 2003 09:30:15 +0100
- Subject: Re: error: no matching function for call to `Anton::Anton(Anton)`
- Organization: Codesourcery LLC
- References: <5.2.1.1.0.20031008132129.0183dc80@iplan-mn.corp.adobe.com>
Eljay Love-Jensen wrote:
Hi Eric,
You should put a copy constructor in your Anton class.
"Anton(Anton& a)" isn't a copy constructor. You need an "Anton(Anton const& a)".
Anton (Anton &), _is_ a copy constructor, it just isn't a const copy constructor.
[12/1]/10
You'll be able to copy non-const objects, but not copy const ones.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk