Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: Change to delete is in order Message-ID: <10585@alice.UUCP> Date: 17 Mar 90 05:30:03 GMT References: <5136@odin.SGI.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 20 In article <5136@odin.SGI.COM>, shap@delrey.sgi.com (Jonathan Shapiro) writes: > I believe that a small change to the definition of the delete operator > is worth considering. The change would have no effect on correct > programs, but would help find incorrect programs in some circumstances. > delete should be defined to zero the pointer it is handed > after freeing the associated store. But the pointer might not be an lvalue! In any event, if you look at the latest C++ reference manual, you will find that the implementation is permitted (but not obliged) to zero the pointer that is the subject of `delete.' It is not obliged to do so in case some people don't want to live with the small amount of additional overhead implied. -- --Andrew Koenig ark@europa.att.com