DList.opOpAssign

Append the elements of rhs at the end of the list.

If no allocator was provided when the list was created, the GCAllocator.std.experimental.allocator. will be used.

struct DList(T)
ref
opOpAssign
(
string op
U
)
(
auto ref U rhs
)
if (
op == "~" &&
(
is(U == typeof(this)) ||
is(U : T)
||
(
isInputRange!U &&
isImplicitlyConvertible!(ElementType!U, T)
)
)
)

Parameters

rhs U

can be an element that is implicitly convertible to T, an input range of such elements, or another doubly linked list

Return Value

Type: auto ref

a reference to this list

Complexity: O(n + m), where m is the number of elements in rhs.

Examples

import std.algorithm.comparison : equal;

auto d = DList!int(4, 5);
DList!int dl;
assert(dl.empty);

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

// append an input range
dl ~= d;
assert(equal(dl, [1, 2, 3, 4, 5]));
d.front = 0;
assert(equal(dl, [1, 2, 3, 4, 5]));

Meta