Array operations with array of structs

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 11 06:43:52 PDT 2015


On Saturday, 11 July 2015 at 13:31:12 UTC, Peter wrote:
> The postblit can only not take @nogc due to the array 
> duplication which is understandable.
> I think the postblit might be redundant anyway since the struct 
> is built on a static array so there is no possibility of two 
> different Vect3s "pointing" to the same data.
> Can someone confirm or does the postblit do anything else?

The postblit is pointless, yes. The `.dup` copies from one 
location to another, only for the assignment to copy everything 
back to the original location; and then the new array is 
discarded.


More information about the Digitalmars-d-learn mailing list