On Sat, 2021-11-20 at 06:15 +0000, Stanislav Blinov via Digitalmars-d- announce wrote: > On Saturday, 20 November 2021 at 05:37:42 UTC, rikki cattermole > wrote: > > And then there are issues such as > > https://issues.dlang.org/show_bug.cgi?id=21416 which killed off > > any chance of me using them internally. > > ...and the implementation, as presented, falls apart due to not > forwarding arguments correctly. Not insurmountable, of course, > although `forward` really should be an intrinsic and not a > library function. > > And due to looking for a `__dtor` instead of `__xdtor`. And due > to the fact that ya can't use the proposed `destroy` function > with a reference to base class and still call the destructor of > derived class correctly, let alone infer attributes correctly. > And due to it trusting the `pureFree` when it shouldn't. > > Can't see anything news-worthy here. This has been possible for > ages, and is still limited to wazoo by classes being married to > druntime, pessimized by lack of proper forwarding in the > language, and can't be @safe.
I decided to have a simple approach just to show that it is easier now to do that without workarounds, and by workarounds, I mean using scope to fetch that info and use a fake dtor, or even before scope exists, the usage of runtime-less D call with betterC + objcopy, described [here](https://theartofmachinery.com/2018/05/27/cpp_classes_in_betterc. html). -- Sincerely, Luís Ferreira @ lsferreira.net
signature.asc
Description: This is a digitally signed message part
