From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HEADER_SPAM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-Thread: fc772,b30bd69fa8f63cb2 X-Google-Attributes: gidfc772,public X-Google-ArrivalTime: 2003-06-14 17:43:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uwm.edu!rpi!not-for-mail From: Wesley Groleau Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 14 Jun 2003 20:45:37 -0400 Organization: Ain't no organization here! Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> Reply-To: wesgroleau@despammed.com NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Sat, 14 Jun 2003 16:29:56 -0500 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPuvBrkHMCo9UcraBAQGCZAH/a3ZaK1ukFiNI0qeHHHnfA5F9BuT9cQ3f xfzY+ZSLQbGoRKhmMfYotO45tRhk1jRv8G8EWb2T5aLTarBOX+2Qhw== =GqH5 Xref: archiver1.google.com comp.lang.ada:39190 comp.lang.c++.moderated:68377 Date: 2003-06-14T20:45:37-04:00 List-Id: > > In Ada, GC is automatic for stack variables, > [snip] > > In C++ GC is automatic for stack variables as well - and via And in any other language that has a calling stack. > > cause timing problems. However, Ada 95 did add the ability > > for the programmer to define whether GC occurs for any particular > > data type, as well as to define how it occurs. > > What do you mean by 'define how it occurs'? In C++ one 'defines how it > occurs' by overloading new and delete, ..... Same thing, different names. If you need any kind of auto-initialization or cleaning (which means not only GC, but closing files, reference counting, all sorts of things) you declare the type to be an extension of Finalization.Controlled and override/extend the Initialize, Adjust, and Finalize operations. Of course, that means you can't do it with ordinary numbers, characters, and other simple types, but, who needs to? [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ] [ about comp.lang.c++.moderated. First time posters: do this! ]