From: sparhawk AT eunet DOT at (Gerhard Gruber) Newsgroups: comp.os.msdos.djgpp Subject: Re: Deconstructors Date: Sat, 18 Jul 1998 10:16:08 GMT Organization: Customer of EUnet Austria Lines: 48 Message-ID: <35b0757c.6543544@news.Austria.EU.net> References: <35AFE02F DOT 3C4857ED AT logic-gate DOT com> <35AFEF99 DOT 29955266 AT alcyone DOT com> <35b6691c DOT 3375145 AT news DOT Austria DOT EU DOT net> <35B06FF0 DOT E4E83F1 AT alcyone DOT com> NNTP-Posting-Host: e093.dynamic.vienna.at.eu.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit Precedence: bulk Destination: Erik Max Francis From: Gruber Gerhard Group: comp.os.msdos.djgpp Date: Sat, 18 Jul 1998 02:50:40 -0700: >Even if that's true, it doesn't have any bearing on whether the C++ >class objects are actually _constructed_ or not. On Linux, gcc 2.7.2.2 >destructs automatic objects immediately after block exit, regardless of >whether or not it's the main function block. I just used main. You can use any other function as main is not really special as a function. >> Your above statement >> would mean >> that c1 is constructed at the entry of main (that's true) and >> deconstructed at >> the exit of main (also true). But c2 would be constructed afer >> entering the >> condition and deconstructed when leaving that condition. I'm nbot sure >> if this >> is true. > >It is with gcc, and thus almost certainly with DJGPP. Give it a try. I will. But I really wonder about this, because this would mean that gcc treats classes totally different from other variables. > >> That's why I usually write a function that resets the object and call >> this >> function when I need it and also from the destructor. > >You are talking about something which is not the same thing as "calling >the destructor." Yes. I know. This was only a suggestion if somebody needs to call the destructor functionality. -- Bye, Gerhard email: sparhawk AT eunet DOT at g DOT gruber AT sis DOT co DOT at Spelling corrections are appreciated.