🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #368

Re: delete [] p

#368
From: Ron Guilmette
Date: Sat, 18 Aug 1990 07:58
27 lines
1262 bytes
In article <1990Aug16.162718.14828@sco.COM> tom@sco.COM (Tom Kelly) writes:
<The recent discussion of delete [] in comp.lang.c++ got me to thinking
<about some example C++ code I've seen.
<
...
<	delete str;
...
<
<The same code (essentially) appears in Dewhurst & Stark,
<_Programming in C++_, p. 70.
<
<It seems to me that the delete statement is incorrect, it
<should be delete [].  According to E&S (ARM), section 5.3.4, p. 21:
<
<"The effect of deleting an array with the plain delete syntax
<is undefined".

I believe that it would be useful to also have a compile-time enforcable
constraint here, e.g.:

	It is illegal for the pointer given in a plain delete
	statement to be of any pointer-to-array type.
-- 

// Ron Guilmette  -  C++ Entomologist
// Internet: rfg@ncd.com      uucp: ...uunet!lupine!rfg
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.
Technical Details
Message-ID: <1231@lupine.NCD.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lupine!rfg
References: <1990Aug16.162718.14828@sco.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lupine!rfg
From: rfg@NCD.COM (Ron Guilmette)
Newsgroups: comp.std.c++
Subject: Re: delete [] p
Message-ID: <1231@lupine.NCD.COM>
Date: 18 Aug 90 07:58:33 GMT
References: <1990Aug16.162718.14828@sco.COM>
Organization: Network Computing Devices, Inc., Mt. View, CA
Lines: 27