Swaps two elements in-place of a range r, specified by their indices i1 and i2.
a range with swappable elements
first index
second index
import std.algorithm.comparison : equal; auto a = [1, 2, 3]; a.swapAt(1, 2); assert(a.equal([1, 3, 2]));
See Implementation
Swaps two elements in-place of a range r, specified by their indices i1 and i2.