List.opAssign

Assigns a new value rhs to the list, replacing its current contents.

Parameter rhs can by type of null, List or input range of ElementType elements.

  1. void opAssign(typeof(null) rhs)
    struct List
    scope
    void
    opAssign
    ()
    (
    typeof(null) rhs
    )
  2. void opAssign(R range)
  3. void opAssign(Rhs rhs)

Examples

List!(int) list = List!(int).build(1, 2, 3);
assert(!list.empty);

list = null;
assert(list.empty);

list = List!(int).build(3, 2, 1);
assert(list == [3, 2, 1]);

list = List!(int).build(4, 2);
assert(list == [4, 2]);

Meta