LateArray
sealed class LateArray<T>import LateArray from Wax;The backing type of lateinit T[], whose reference-bearing slots may initially be unassigned.
Writes assign slots; reads of unassigned slots panic. Use IsAssigned or AllAssigned to
inspect initialization, and AsArray to verify and obtain a dense alias. Promotion does not
copy or remove the original writable handle.
Inherits from object. Follow these links for inherited members.
Members
sizefield
public native int32 sizeThe number of allocated slots, including unassigned slots.
thisindexer-getter
public get this(int32 index) : TReads or assigns a zero-based slot. Out-of-range indices panic; reads also panic if the slot is unassigned.
thisindexer-setter
public set this(int32 index, T value) : voidReads or assigns a zero-based slot. Out-of-range indices panic; reads also panic if the slot is unassigned.
IsAssignedmethod
public fn IsAssigned(int32 index) : boolTests whether an in-range slot contains a value. It does not read an unassigned value; an out-of-range index still panics. Reference-free element types are always assigned.
AllAssignedgetter
public get AllAssigned() : boolTests whether every slot is assigned. Empty arrays and reference-free element arrays return true.
AsArraymethod
public fn AsArray() : T[]Verifies every slot is assigned, panicking on a hole, and returns a dense array alias without copying. Writes through either handle remain visible through the other.
Slicemethod
public fn Slice(int32 start, int32 len) : Span<T>Checks a nonnegative in-bounds window and verifies every slot in that window is assigned, then borrows a mutable span. Holes outside the window do not prevent slicing. Invalid ranges or holes in the window panic.
ToWriteOnlySpanmethod
public fn ToWriteOnlySpan() : WriteOnlySpan<T>Borrows a write-only view of the live element range without copying. Writes change the backing storage; the view itself cannot read values.
Fillmethod
public fn Fill(T value) : voidAssigns every slot and establishes that the whole array is dense. Reference elements all receive the same reference.