TDPL: Manual invocation of destructor

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Aug 9 18:20:31 PDT 2010


Michel Fortin wrote:
> On 2010-08-09 20:53:16 -0400, Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> said:
> 
>> Jonathan M Davis wrote:
>>> I would take that as an argument for making clear() set the object in 
>>> the state prior to the constructor call.
>> [snip]
>>
>> I agree. Do others?
> 
> Well, allowing clear on any class is dangerous for a program's integrity 
> as a whole, whether you call a destructor or not.
> 
> So my opinion is that it should either not exist, if it exists it should 
> be buried somewhere with other functions that subvert the type system,

clear() would not subvert the type system.

Andrei


More information about the Digitalmars-d mailing list