D's Destructors are What Scott Meyers Warned Us About
Manu
turkeyman at gmail.com
Wed May 23 17:41:53 UTC 2018
On 23 May 2018 at 05:38, Steven Schveighoffer via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 5/22/18 10:15 PM, Manu wrote:
>>
>> If you're in the mood to prepare a DIP, I think you should prepare this
>> dip:
>>
>> Support the syntax:
>> classInstance.~this();
>
>
> Isn't this just classInstance.destroy() ?
Is everything in object.d globally available? You don't have to import
`destroy()` right?
My nit-pick is that destroy resets to .init after destruction, which
makes it feel like more than a destroy, and that is almost certainly
the reason people reach for __xdtor() when they do (ie, they JUST want
to destruct).
We should probably address that, and then publish a strong recommendation.
More information about the Digitalmars-d
mailing list