help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are delete and delete[] equivalent?


From: Hallvard B Furuseth
Subject: Re: Are delete and delete[] equivalent?
Date: Tue, 11 Apr 2006 20:21:22 +0200

Aj writes:

> I am pretty sure that what "delete" does when given an array is
> implementation dependent.

Indeed.  "behavior is undefined" is standardese for saying:

(a) Compiler implementor, you may compile such code into whatever you
    wish - let it crash, or assume that 2==3, or make it the syntax for
    some extension of yours, or whatever.

(b) Programmer, don't write code which does this.  At least not if you
    want your program to be portable.  And even if it happens to work in
    some program with some compiler, don't assume it always will even on
    that compiler, unless its documentation explicitly says so.

> That is why I asked this question in a g++ forum.

Because you want your code to only work with g++?

-- 
Hallvard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]