Why will the delete keyword be removed?

Vladimir Panteleev vladimir at thecybershadow.net
Wed Jul 14 17:42:21 PDT 2010


On Thu, 15 Jul 2010 03:05:34 +0300, Jonathan M Davis  
<jmdavisprog at gmail.com> wrote:

> On Wednesday, July 14, 2010 16:52:24 Vladimir Panteleev wrote:
>> On Thu, 15 Jul 2010 02:46:22 +0300, Jonathan M Davis
>>
>> <jmdavisprog at gmail.com> wrote:
>> > On Wednesday, July 14, 2010 16:28:40 Vladimir Panteleev wrote:
>> >> On Thu, 15 Jul 2010 00:33:15 +0300, Andrei Alexandrescu
>> >>
>> >> <SeeWebsiteForEmail at erdani.org> wrote:
>> >> > All classes have a state where all members are default initialized.
>> >>
>> >> How is that state normally reached (for classes without a default
>> >> constructor)?
>> >
>> > It's the state that the object is in before the constructor is called.
>> > All of
>> > the object's members are initialized to their default value or  
>> whatever
>> > value
>> > you assigned to them at their point of declaration (which must be a
>> > value which
>> > can be determined at compile time). It's not necessarily a valid state
>> > for the
>> > object, logically speaking (with regards to invariants and the like),
>> > but it's a
>> > safe state memory-wise.
>>
>> That was obvious and not what I really asked, but thanks anyway :)
>
> Well, then I'm afraid that I don't get what you were asking, because  
> that's what
> it sounded like you were asking.
>
> - Jonathan M Davis

By "reaching that state" I meant a state as would be visible by code other  
than the object constructor or destructor. As Michel said, Andrei's  
proposal leaves the object in a state where its invariants could fail.

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


More information about the Digitalmars-d mailing list