SList.this

Initializes this list from another one.

If init is passed by value, it won't be copied, but moved. If the allocator of ($D_PARAM init) matches allocator, $(D_KEYWORD this) will just take the ownership over init's storage, otherwise, the storage will be allocated with allocator and all elements will be moved; init will be destroyed at the end.

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

Parameters

R

Source list type.

init R

Source list.

allocator Allocator

Allocator.

Examples

auto l1 = SList!int([5, 1, 234]);
auto l2 = SList!int(l1);
assert(l1 == l2);

Meta