www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/12/05:13:42

Date: Tue, 12 Sep 2000 11:12:52 +0200
From: Egon Eckert <egon AT chance DOT cz>
To: djgpp AT delorie DOT com
Subject: Re: strdup() with delete[]
Message-ID: <20000912111252.C30292@chance.cz>
References: <F82wV0zqedbDoW8JHY90000922c AT hotmail DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.0.1i
In-Reply-To: <F82wV0zqedbDoW8JHY90000922c@hotmail.com>; from n_abing@hotmail.com on Mon, Sep 11, 2000 at 06:49:04PM +0000
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> delete [] obj_ptr is not obsolete. It is _the_proper_ way to deallocate
> an array of objects. What is obsolete is delete [nn] obj_ptr, where
> NN would be the number of objects that were allocated for the array.

So, is the delete [] form a hint for the compiler "use vector delete, there
may be more objects", and the 'simple' delete (without []) is faster
(because it doesn't need to find out how many objects there are)?

This is the only reason I would accept the existance of these 2 forms. :)

You could also clarify me, why '==' has higher precedence than '&' (which I
find weird), but this would be totally off-topic..

-- 
Egon Eckert, Chance, a.s.
E-mail: egon AT chance DOT cz

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019