Safely moving structs in D

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 23 15:04:45 PST 2017


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 for copying though. Moving should not call post-blit. You 
may want to look at the implementation of std.algorithm.move to see how 
it plays with post-blit:

   https://dlang.org/phobos/std_algorithm_mutation.html#.move

Ali



More information about the Digitalmars-d-learn mailing list