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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx    ::     http://www.planetfall.pwp.blueyonder.co.uk



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux