Function swap [src]
Exchanges contents of two memory locations.
Prototype
pub fn swap(comptime T: type, a: *T, b: *T) void Parameters
T: typea: *Tb: *T Source
pub fn swap(comptime T: type, a: *T, b: *T) void {
const tmp = a.*;
a.* = b.*;
b.* = tmp;
}