← Standard library

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.

LateArray.wax:26

Inherits from object. Follow these links for inherited members.

Members

sizefield

public native int32 size

The number of allocated slots, including unassigned slots.

LateArray.wax:33

thisindexer-getter

public get this(int32 index) : T

Reads or assigns a zero-based slot. Out-of-range indices panic; reads also panic if the slot is unassigned.

LateArray.wax:41

thisindexer-setter

public set this(int32 index, T value) : void

Reads or assigns a zero-based slot. Out-of-range indices panic; reads also panic if the slot is unassigned.

LateArray.wax:46

IsAssignedmethod

public fn IsAssigned(int32 index) : bool

Tests 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.

LateArray.wax:54

AllAssignedgetter

public get AllAssigned() : bool

Tests whether every slot is assigned. Empty arrays and reference-free element arrays return true.

LateArray.wax:63

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.

LateArray.wax:73

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.

LateArray.wax:91

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.

LateArray.wax:114

Fillmethod

public fn Fill(T value) : void

Assigns every slot and establishes that the whole array is dense. Reference elements all receive the same reference.

LateArray.wax:124