www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/18/06:46:26

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Deconstructors
Date: Sat, 18 Jul 1998 03:26:18 -0700
Organization: Alcyone Systems
Lines: 48
Message-ID: <35B0784A.666728D4@alcyone.com>
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> <35b0757c DOT 6543544 AT news DOT Austria DOT EU DOT net>
NNTP-Posting-Host: charmaine.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019