Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Re: Change to delete is in order Message-ID: <25FC0210.26173@paris.ics.uci.edu> Date: 12 Mar 90 20:09:53 GMT References: <5136@odin.SGI.COM> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 15 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. That would be a swell idea, except that I don't believe that the value in a delete statement is required to be an lvalue. What should the compiler do if the value is *not* an lvalue? Punt? // Ron Guilmette (rfg@ics.uci.edu) // C++ Entomologist // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.