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 a = Array!int(1, 2, 3); assert(equal(a, [1, 2, 3])); } // Create a list from an array of ints { auto a = Array!int([1, 2, 3]); assert(equal(a, [1, 2, 3])); } // Create a list from a list from an input range { auto a = Array!int(1, 2, 3); auto a2 = Array!int(a); assert(equal(a2, [1, 2, 3])); }
Constructs a qualified array out of a number of items. Because no allocator was provided, the array will use the GCAllocator.std.experimental.allocator.gc_allocator..