On Thursday, 5 July 2018 at 10:57:51 UTC, Dukc wrote:
D does not have default constructors for structs, but I have thought that this might get around the problem:[...]
You already have that capability:
struct HandGrenade {
void* ptr;
void destroy() {
import core.stdc.stdlib: free;
free(ptr);
}
}
This isn't a great example since it's perfectly fine to pass null
to core.stdc.stdlib.free.
Atila
