Copying structs via function (not bitwise)

downs default_357-line at yahoo.de
Fri Feb 15 10:33:05 PST 2008


Bill Baxter wrote:
> 
> You can't make natural syntax work for everything but you _can_ make
> unnatural syntax work for everything.  I.e. you could make it so that:
> 
> T i,j = 0;
> assign(i,j);
> j++;
> assert(i==0);
> 
> works for all the T's you want it to.
> Not quite as sweet as having it all appear to be built-in but better
> than a spoon in the eye.
> 
> --bb

How about keeping to D conventions, and using j = i.dup?

 --downs


More information about the Digitalmars-d-learn mailing list