lame question

lenochware lenochware at gmail.com
Wed Apr 20 02:09:06 PDT 2011


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
> On 4/19/11 1:04 PM, Timon Gehr wrote:
> > Steven Schveighoffer wrote:
> >> And one other note -- delete will eventually be deprecated.  In order to
> >> free memory, you must use clear and GC.free.
> >
> >> -Steve
> >
> > Well, why? It seems like a bad decision to me.
> The feature is not going away, just the keyword.
> "delete" is a gratuitous carryover from C++, which had to invent it
> because the need for manual object disposal predated the introduction of
> templates.
> D stays a systems programming language but also has a safe subset and
> generally offers better safety guarantees than C++. It is excessive to
> allocate a keyword to a feature that's fundamentally unsafe,
> particularly since the underlying feature offers considerably fewer
> guarantees than its C++ counterpart. (Some GCs are unable to implement
> "delete" meaningfully.)
> Manual memory disposal for the GC heap will be implemented as a template
> function with semantics defined by the GC implementation.
> Andrei

Well, I don't understand internal architecture at all, but from user's point of
view it would be good keep some simple and nice way to remove object. I like if I
can have things under control - if I want.


More information about the Digitalmars-d mailing list