ArrayTag.opOpAssign

Concatenates T, an array of T or a NBT array of T to the tag.

class ArrayTag(T, NBT_TYPE _type)
@safe
void
opOpAssign
(
string op : "~"
G
)
()
if (
is(G == T) ||
is(G == T[])
)

Examples

auto array = new IntArray([1]);

array ~= 1;
assert(array == [1, 1]);

array ~= [1, 2, 3];
assert(array == [1, 1, 1, 2, 3]);

array ~= new IntArray([100, 99]);
assert(array == [1, 1, 1, 2, 3, 100, 99]);

Meta