crystal clear()
Vladimir Panteleev
vladimir at thecybershadow.net
Sat Sep 18 08:19:44 PDT 2010
On Sat, 18 Sep 2010 00:33:11 +0300, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> That's a great point. So we're in good shape: we leave the object in a
> well-defined state that allocates no resources and is distinguished from
> all valid states.
By the way, what would be the problem with making "delete" do this
(instead of deprecating and removing it)?
Asking because of two reasons:
1) I think that custom class allocators/deallocators[1] are a great
feature, which require the "delete" keyword.
2) "delete foo" looks much nicer and coherent with other similar languages
than "clear(foo)".
[1]: http://digitalmars.com/d/2.0/memory.html#newdelete
--
Best regards,
Vladimir mailto:vladimir at thecybershadow.net
More information about the Digitalmars-d
mailing list