Manual memory management in D2

Vladimir Panteleev vladimir at thecybershadow.net
Tue Jul 13 04:48:58 PDT 2010


On Mon, 12 Jul 2010 09:16:58 +0300, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> 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.

I'm sorry, but what if I manage my memory manually and don't use the GC?  
Or will that soon be deprecated as well?

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list