Array length
parameters for constructor for each array element.
The array elements are constructed as if by the expression emplace!ElementType(_payload, args), where _payload is an internal pointer to storage suitable to hold an object of type ElementType. The storage is typically larger than ElementType.sizeof * n in order to use one allocation for both the control block and the each array element.
auto a = allocatorObject(Mallocator.instance); auto arr = RcPtr!(long[], DestructorType!(typeof(a))).alloc(a, 6, -1); assert(arr.length == 6); assert(arr.get.length == 6); import std.algorithm : all; assert(arr.get.all!(x => x == -1)); for(int i = 0; i < 6; ++i) arr.get[i] = i; assert(arr.get == [0, 1, 2, 3, 4, 5]);
Constructs an object of array type ElementType including its array elements and wraps it in a RcPtr.