Mail Archives: djgpp/1998/07/18/06:31:44
Destination: Erik Max Francis <max AT alcyone DOT com>
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.
- Raw text -