a positive integer
an input range of elements that are implitictly convertible to T; a variable number of items either in the form of a list or as a built-in array
the number of elements inserted
Complexity: O(pos + m), where m is the number of elements in the range.
import std.algorithm.comparison : equal; auto s = SList!int(4, 5); SList!int sl; assert(sl.empty); size_t pos = 0; pos += sl.insert(pos, 1); pos += sl.insert(pos, [2, 3]); assert(equal(sl, [1, 2, 3])); // insert from an input range pos += sl.insert(pos, s); assert(equal(sl, [1, 2, 3, 4, 5])); s.front = 0; assert(equal(sl, [1, 2, 3, 4, 5]));
Inserts the elements of an input range, or a variable number of items, at the given pos.
If no allocator was provided when the list was created, the GCAllocator.std.experimental.allocator. will be used.