SList.opAssign

Assigns another list.

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.

  1. typeof(this) opAssign(R that)
  2. typeof(this) opAssign(R that)
    struct SList(T)
    ref
    typeof(this)
    opAssign
    (
    R
    )
    ()
    if (
    is(R == SList)
    )
  3. typeof(this) opAssign(R that)
  4. typeof(this) opAssign(T[R] that)

Parameters

R

Content type.

that R

The value should be assigned.

Return Value

Type: typeof(this)

$(D_KEYWORD this).

Examples

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

Meta