Manual memory management in D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jul 11 23:16:58 PDT 2010


On 07/11/2010 11:24 PM, Vladimir Panteleev wrote:
> On Mon, 12 Jul 2010 00:00:46 +0300, bearophile
> <bearophileHUGS at lycos.com> wrote:
>
>> A std lib function is not set in stone, later it can be improved,
>> modified, etc.
>
> But the same could be said about any language feature! Deprecating the
> delete statement, and increasing the verbosity of the code for the sake
> of customizability appears absurd to me. Why not move the implementation
> of the delete statement to the standard library (if it's not there
> already) and get it to do the same as the fancy new clear() thing?

delete shouldn't have been a keyword in the first place - it's only 
justified historically (it was defined before templates existed etc). 
Anyway, changing its meaning at this point is bound to confuse C++ comers.

I don't think writing clear(obj) is more taxing that writing delete obj.


Andrei


More information about the Digitalmars-d mailing list