Is it ok to memcpy/memmove a struct in D?

Quote from here:
https://dlang.org/spec/garbage.html

"Do not have pointers in a struct instance that point back to the same instance. The trouble with this is if the instance gets moved in memory, the pointer will point back to where it came from, with likely disastrous results."

This seems to suggests it's ok to move structs around in memory without calling their postblit...but if this is the case, why does postblit even exist, if it's not strictly guaranteed to be called after the struct has been blitted?


Reply via email to