Josh:

swap(A, B)
what exactly is this doing?

You should learn to answer your own questions in many cases. Take a look at the source code of Phobos, you will see the swap() implementation inside std.algorithm.

It swaps the content of two values. Here the values are the structs that contain the pointer+length of the dynamic arrays.

Bye,
bearophile

Reply via email to