From 8502447427016272407
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,176c9dc06a6729eb
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-03-25 13:03:02 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: jmonk@panix.com (Joseph Monk)
Newsgroups: comp.std.c++
Subject: Re: why doesn't delete NULL the pointer?
Date: Mon, 25 Mar 2002 21:02:39 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <166f05e8.0203240153.127c0f04@posting.google.com>
References: <a7j7vg$78s$1@watserv3.uwaterloo.ca>
X-Trace: mail2news.demon.co.uk 1017090165 mail2news:24986 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Date: 24 Mar 2002 09:53:12 GMT
Lines: 30
Xref: archiver1.google.com comp.std.c++:10177

Stroustrup has a whole discussion about exactly this subject at
"http://www.research.att.com/~bs/bs_faq2.html#delete-zero".

Fairly exhaustive,

Joe.

p2sam@uwaterloo.ca (Pedro Sam) wrote in message news:<a7j7vg$78s$1@watserv3.uwaterloo.ca>...
> Hi all,
> 
> I'm curious about the delete operator and NULL pointers.  Why doesn't
> the standard require that the delete operator to set the pointer's value
> to NULL?  
> 
> If the pointer is NULL, then if someone comes along and try to access
> that pointer, it would crash with a segfault, instead of reading garbage
> ( or even worse, write over some memory ).
> 
> Crash early is a Good Thing(TM) right?
> 
> I would appreciate any comments.
> 
> p2sam

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



