Manual memory management in D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jul 13 08:09:58 PDT 2010


On 07/13/2010 06:48 AM, Vladimir Panteleev wrote:
> 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?

No. Only inherently mistaken features such as delete are deprecated.

Andrei



More information about the Digitalmars-d mailing list