DList.opAssign - multiple declarations

Function DList.opAssign

Assigns another list.

ref typeof(this) opAssign(R) (
  ref R that
)
if (is(Unqual!R == DList));

ref typeof(this) opAssign(R) (
  R that
)
if (is(R == DList));

If that is passed by value, it won't be copied, but moved. This list will take the ownership over that's storage and the allocator.

If that is passed by reference, it will be copied.

Parameters

NameDescription
R Content type.
that The value should be assigned.

Returns

this.

Function DList.opAssign

Assigns an input range.

ref typeof(this) opAssign(R) (
  scope R that
) @trusted
if (!isInfinite!R && isInputRange!R && isImplicitlyConvertible!(ElementType!R, T));

Parameters

NameDescription
R Type of the initial range.
that Values to initialize the list with.

Returns

this.

Example

auto l1 = DList!int([5, 4, 9]);
auto l2 = DList!int([9, 4]);
l1 = l2[];
assert(l1 == l2);

Function DList.opAssign

Assigns a static array.

ref typeof(this) opAssign(size_t R) (
  T[R] that
);

Parameters

NameDescription
R Static array size.
that Values to initialize the list with.

Returns

this.

Example

auto l1 = DList!int([5, 4, 9]);
auto l2 = DList!int([9, 4]);
l1 = [9, 4];
assert(l1 == l2);