D's Destructors are What Scott Meyers Warned Us About
Steven Schveighoffer
schveiguy at yahoo.com
Wed May 23 15:43:31 UTC 2018
On 5/23/18 9:12 AM, Steven Schveighoffer wrote:
> On 5/22/18 9:59 PM, sarn wrote:
>> (Unfortunately destroy() currently isn't zero-overhead for plain old
>> data structs because it's based on RTTI, but at least it works.)
>
> Hm.. that should be fixed. I don't see why we can't just do = T.init, we
> should at least be optimizing to this for small enough structs.
Coincidentally, this JUST changed due to a different reason:
https://github.com/dlang/druntime/pull/2178
> Please file an enhancement request.
I still think it could be better, so I added a further issue:
https://issues.dlang.org/show_bug.cgi?id=18899
-Steve
More information about the Digitalmars-d
mailing list