June 15, 2018 Wouldn't it be far fetch for finalize to be allowed to call only attrubutes in certain context? | ||||
---|---|---|---|---|
| ||||
Example: @nogc void stuff() { A.destroy(); //Call destructors that is marked with @nogc due to being in context } Granted there is a risk of not calling all the destructors, but I think that responsibility lies on the programmer when designing the class. |
June 16, 2018 Re: Wouldn't it be far fetch for finalize to be allowed to call only attrubutes in certain context? | ||||
---|---|---|---|---|
| ||||
Posted in reply to 12345swordy | On 6/15/18 6:55 PM, 12345swordy wrote:
> Example:
> @nogc void stuff()
> {
> A.destroy(); //Call destructors that is marked with @nogc due to being in context
> }
> Granted there is a risk of not calling all the destructors, but I think that responsibility lies on the programmer when designing the class.
I think we can do this, but we don't need to integrate with ~this. Just make a new function. e.g. destroy_hook or something.
The compiler already can distinguish the overloads and call the right one, I think.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation