On Tuesday, 24 January 2017 at 11:46:47 UTC, Jonathan M Davis
wrote:
On Monday, January 23, 2017 22:26:58 bitwise via
Digitalmars-d-learn wrote:
[...]
Moving structs is fine. The postblit constructor is for when
they're copied. A copy is unnecessary if the original isn't
around anymore -
On Monday, January 23, 2017 22:26:58 bitwise via Digitalmars-d-learn wrote:
> 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
On Monday, 23 January 2017 at 23:04:45 UTC, Ali Çehreli wrote:
On 01/23/2017 02:58 PM, bitwise wrote:
I'm confused about what the rules would be here.
It would make sense to call the postblit if present, but
std.Array
currently does not:
On 01/23/2017 02:58 PM, bitwise wrote:
I'm confused about what the rules would be here.
It would make sense to call the postblit if present, but std.Array
currently does not:
https://github.com/dlang/phobos/blob/04cca5c85ddf2be25381fc63c3e941498b17541b/std/container/array.d#L884
Post-blit is
On Monday, 23 January 2017 at 22:26:58 UTC, bitwise wrote:
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
I'm confused about what the rules would be here.
It would make sense to call the postblit if present, but
std.Array currently does not:
https://github.com/dlang/phobos/blob/04cca5c85ddf2be25381fc63c3e941498b17541b/std/container/array.d#L884
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,