a variable number of items, either in the form of a list or as a built-in array
Complexity: O(m), where m is the number of items.
import std.algorithm.comparison : equal; // Create a list from a list of ints { auto dl = DList!int(1, 2, 3); assert(equal(dl, [1, 2, 3])); } // Create a list from an array of ints { auto dl = DList!int([1, 2, 3]); assert(equal(dl, [1, 2, 3])); } // Create a list from a list from an input range { auto dl = DList!int(1, 2, 3); auto dl2 = DList!int(dl); assert(equal(dl2, [1, 2, 3])); }
Constructs a qualified doubly linked list out of a number of items. Because no allocator was provided, the list will use the GCAllocator.std.experimental.allocator..