Swap array contents?

No don’t do that.

Yes, these are the correct solutions. As I said, binding swapping is exactly what corresponds to the c++ swap. The conceptual difference between c++ and julia is why such operations are needed in c++ to begin with.