Mail Archives: djgpp/1998/07/18/06:46:26
Gerhard Gruber wrote:
> I just used main. You can use any other function as main is not really
> special
> as a function.
Your example involved a block off of main, which is what I was talking
about.
> I will. But I really wonder about this, because this would mean that
> gcc
> treats classes totally different from other variables.
It means that it's handling it the way the C++ definition says it
should.
Consider:
class C { ... };
for (...) // some for loop
{
C c(...);
// do something with c
}
If c isn't being created and destructed every iteration of the loop,
you've got a problem.
Again: construction/destruction and reservation of memory on the stack
aren't necessarily one and the same, although I'm not even sure that
your statement about that standard behavior is true. (It certainly
isn't required by the C/C++ function model.)
> Yes. I know. This was only a suggestion if somebody needs to call the
> destructor functionality.
What you are calling "destructor functionality" is not the same thing as
what C++ does when it destructs an object.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm:+37.20.07/-121.53.38
\
I put away my nine, fool / 'cause I'm colorblind.
/ Ice Cube
- Raw text -