What is a serial copy? Is it different from a deep copy and a shallow copy?
According to the wiki entry in the Duff device , it is traditionally implemented as:
do { //count > 0 assumed *to = *from++; //Note that the 'to' pointer is NOT incremented } while(--count > 0);
And then he takes a note, saying
Note that to does not increase because Duff copied to a single output disk with memory mapping.
I did not quite understand this note.
If the to pointer does not increase, then what is the point of the loop? Why then is it implemented as:
*to = from[count-1]; //does it not do the same thing?
I suspect it has something to do with defining a serial copy.
How can we allocate memory for to so that the loop has some meaning?
source share