On Sunday, 11 September 2016 at 05:44:13 UTC, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by
reference (which, BTW, is not mentioned at all here:
https://dlang.org/spec/struct.html#nested). And bliting a
struct obviously doesn't do a deep copy of its context.
So my question is, is there a way to deep copy the context of a
struct?
I've tried a few things, but I don't think you can. The root
issue is that the context pointer is void*, so you can't do
meaningful reflection on it.