From -9173886739889635060
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,afd7c5d805e2c577
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1993-03-22 22:56:13 PST
Newsgroups: comp.std.c++
Path: sparky!uunet!taumet!steve
From: steve@taumet.com (Steve Clamage)
Subject: Re: Is delete [] always safe?
Message-ID: <1993Mar22.182057.12979@taumet.com>
Organization: TauMetric Corporation
References: <1993Mar22.024915.14564@fcom.cc.utah.edu>
Date: Mon, 22 Mar 1993 18:20:57 GMT
Lines: 15

dave@fcom.cc.utah.edu (Dave Martin) writes:

>Is it safe to do a delete [] pointer when pointer is not a vector?

No, it is never safe.

> What does/will the standard say?

The same thing the ARM already says.  The form of the delete-expression
must match the form of the new-expression.  You use the "[]" form in
the delete-expression if and only if the corresponding new-expression
used that form.  Anything else is an error and has undefined results.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com


