This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error: no matching function for call to `Anton::Anton(Anton)`


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]