Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread kinke via Digitalmars-d-learn
On Saturday, 31 July 2021 at 13:59:46 UTC, Tejas wrote: On Saturday, 31 July 2021 at 13:57:40 UTC, kinke wrote: This is possible via: ``` __dtor(); super.__dtor(); ``` WHOO YEAH!!! THANK YOU SO MUCH :D Heh you're welcome. Note that you'll probably want `__xdtor()`, which also destructs

Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread Tejas via Digitalmars-d-learn
On Saturday, 31 July 2021 at 13:57:40 UTC, kinke wrote: This is possible via: ``` __dtor(); super.__dtor(); ``` WHOO YEAH!!! THANK YOU SO MUCH :D

Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread kinke via Digitalmars-d-learn
This is possible via: ``` __dtor(); super.__dtor(); ```

Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread Tejas via Digitalmars-d-learn
On Saturday, 31 July 2021 at 13:34:25 UTC, user1234 wrote: On Saturday, 31 July 2021 at 13:12:21 UTC, Tejas wrote: ```d class A{ ~this(){} destructA(){ ~this() } } class B:A{ ~this(){} destructB(){ ~this(); ~super(); } } ``` This could allow

Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread Tejas via Digitalmars-d-learn
On Saturday, 31 July 2021 at 13:34:25 UTC, user1234 wrote: On Saturday, 31 July 2021 at 13:12:21 UTC, Tejas wrote: ```d class A{ ~this(){} destructA(){ ~this() } } class B:A{ ~this(){} destructB(){ ~this(); ~super(); } } ``` This could allow

Re: Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread user1234 via Digitalmars-d-learn
On Saturday, 31 July 2021 at 13:12:21 UTC, Tejas wrote: ```d class A{ ~this(){} destructA(){ ~this() } } class B:A{ ~this(){} destructB(){ ~this(); ~super(); } } ``` This could allow ```@nogc``` crowd to run destructors without calling

Why are class methods not allowed to call cons/destructors?

2021-07-31 Thread Tejas via Digitalmars-d-learn
```d class A{ ~this(){} destructA(){ ~this() } } class B:A{ ~this(){} destructB(){ ~this(); ~super(); } } ``` This could allow ```@nogc``` crowd to run destructors without calling ```destroy```. Yes, derived to base conversion is still a thing and