Perform a copy of the list. This will create a new list that will copy the elements of the current list. This will NOT call dup on the elements of the list, regardless if T defines it or not.
a new list.
Complexity: O(n).
import std.algorithm.comparison : equal; auto dl = DList!int(1, 2, 3); auto dlDup = dl.dup; assert(equal(dl, dlDup)); dlDup.front = 0; assert(!equal(dl, dlDup)); assert(dlDup.front == 0); assert(dl.front == 1);
See Implementation
Perform a copy of the list. This will create a new list that will copy the elements of the current list. This will NOT call dup on the elements of the list, regardless if T defines it or not.