Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: Ruben Safir Newsgroups: comp.lang.c++ Subject: Re: Destructors can copying objects Date: Mon, 4 Apr 2011 21:07:33 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: NNTP-Posting-Host: www2.mrbrklyn.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1301951253 27911 96.57.23.82 (4 Apr 2011 21:07:33 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 4 Apr 2011 21:07:33 +0000 (UTC) X-Blackjet: Blackjet is a Yankee Fan X-DRMisTHEFT: Use GNU Linux today X-From: A Dark Cloud X-LOCATION: Brooklyn NY - Forget abou' it! X-NYLXS: Really - yah think computers are supposed to be broken? User-Agent: Pan/0.133 (House of Butterflies) Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:3108 On Sun, 03 Apr 2011 12:29:00 +0100, Leigh Johnston wrote: > On 03/04/2011 10:32, Balog Pal wrote: >> "Ruben Safir" >>> I don't think I have a copy constructor, which might be the problem >>> although it never had been. >> >> Look up "rule of 3". If you have a dtor, you will need a copy cotor and >> operator= too, or must disable them. >> >> > Like most "rules" mentioned in this newsgroup the "rule of 3" is a > nonsense: you may be adding a virtual dtor simply to make a base class > polymorphic and have no need for a copy ctor and assignment operator or > you may be relying on RAII and the behaviour of the implicitly defined > special member functions. > > /Leigh Its hard for me to make that judgment though, without a more concrete understanding of how destructors are triggered with auto values. I'm not sure why any allocated memory created with new and dropped on the heap is auto destructed Ruben