Topic: delete on a lvalue


Author: fabre@osf.org (Christian Fabre)
Date: 27 Jul 1994 13:28:09 GMT
Raw View
Hello C++ gurus,

On "The C++ programming language, 2nd edition" from B.Stroustrup, section r.5.3.4, reads the following:

 [...] If the expression of a delete is a modifiable l-value,
 then its value is undefined after the delete has been performed.

My question is, why is it "undefined" only? I would have prefered the
l-value to be set to NULL after delete.

This would have been much more practical to delete sparse trees, as
delete is already safe on NULL pointers.

So what is the rationale? What will the standard say about this?

Thanks in advance,

Christian.

=====
   Christian Fabre
OSF Research Institute   Net: fabre@gr.osf.org
  2 avenue de Vignate  Tel: +33 76.63.48.90
 38610 Gieres - France   Fax: +33 76.51.05.32