๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7553

Re: Self destructive 0bject/class... (Challange)

#7553
From: FernandoF
Date: Wed, 08 Oct 2003 15:22
16 lines
1749 bytes
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> escribi๏ฟฝ en el mensaje
news:3f0c4519$1@newsgroups.borland.com...
> Sure.  Simply delete the 'this' pointer.  Just make sure you don't make
any
> further accesses to any members of the class after that point, though,
since
> the object is gone and 'this' is now invalid.
>
>     delete this;
>

Well, IMHO I should say that this way is a bit dangerous... What if the
object hasn't been created with new? I know people use to create with new...
but who knows? :-)

Anyway, "delete this;" sounds very hard for me... but works.
Technical Details
Message-ID: <3f842be6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail
References: <3f0c21da@newsgroups.borland.com> <3f0c4519$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,9af595df0adad9f3
X-Google-Attributes: gid10cc67,public
X-Google-Thread: 102541,9af595df0adad9f3
X-Google-Attributes: gid102541,public
X-Google-Thread: 10db1e,9af595df0adad9f3
X-Google-Attributes: gid10db1e,public
X-Google-ArrivalTime: 2003-10-08 08:36:07 PST
From: "FernandoF" <FernandoF@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.oodesign,borland.public.cppbuilder.students
References: <3f0c21da@newsgroups.borland.com> <3f0c4519$1@newsgroups.borland.com>
Subject: Re: Self destructive 0bject/class... (Challange)
Date: Wed, 8 Oct 2003 17:22:54 +0200
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
NNTP-Posting-Host: 212.22.39.106
Message-ID: <3f842be6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065626598 212.22.39.106 (8 Oct 2003 08:23:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail