Vector.proxySwap

Swaps the contents of this and rhs.

struct Vector
scope
void
proxySwap
()
(
ref scope typeof(this) rhs
)

Examples

auto a = Vector!(int, 6).build(1, 2, 3);
auto b = Vector!(int, 6).build(4, 5, 6);

a.proxySwap(b);
assert(a == [4, 5, 6]);
assert(b == [1, 2, 3]);

import std.algorithm.mutation : swap;

swap(a, b);
assert(a == [1, 2, 3]);
assert(b == [4, 5, 6]);

Meta