Thread View: comp.std.c++
3 messages
3 total messages
Started by Earl Chew
Fri, 02 Feb 1996 00:01
delete this
Author: Earl Chew
Date: Fri, 02 Feb 1996 00:01
Date: Fri, 02 Feb 1996 00:01
20 lines
1462 bytes
1462 bytes
I believe that `delete this' is "unsafe". Does the draft standard say this explicitly? Where? Earl -- +----------------------------------------------------------------------+ | Earl Chew Email: earl_chew@aus.hp.com | | Hewlett-Packard Australia Ltd Tel: +61 3 9210 5528 | | Australian Telecom Operation Fax: +61 3 9210 5550 | | 347 Burwood Highway GPS: 37 48'44"S 145 8'51"E | | Burwood East, Victoria 3151, Australia | +----------------------------------------------------------------------+ [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
Re: delete this
Author: Steve Clamage
Date: Fri, 02 Feb 1996 01:23
Date: Fri, 02 Feb 1996 01:23
22 lines
1475 bytes
1475 bytes
In article 5549@hpato.aus.hp.com, Earl Chew <earl@hpato.aus.hp.com> writes: >I believe that `delete this' is "unsafe". > >Does the draft standard say this explicitly? The draft says you must not access a deleted object. If you delete 'this', you can't touch the object or call any functions on it. The draft also says you must not destroy an object twice, and deleting "this" will destroy it once. So, yes, deleting "this" is in general unsafe, since it is harder to make the "no touch" guarantees from inside a member function. You can design a program so that deleting "this" is appropriate, but such programs are not common. --- Steve Clamage, stephen.clamage@eng.sun.com [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
Re: delete this
Author: Nathan Myers, http://www.cantrip...
Date: Mon, 05 Feb 1996 23:30
Date: Mon, 05 Feb 1996 23:30
22 lines
1433 bytes
1433 bytes
Earl Chew wrote: > > I believe that `delete this' is "unsafe". > > Does the draft standard say this explicitly? The Draft doesn't say this, and it shouldn't say this. The subject was discussed in committee. The construct is used in plenty of existing code that we saw no reason to break. It has also been discussed in this newsgroup at length. For the record, I use "delete this" often. It works admirably, in the right context. I don't use it anywhere else. Nathan Myers ncm@cantrip.org http://www.cantrip.org/ [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads