FixedList
sealed class FixedList<T>import FixedList from Wax;An initially empty sequence with fixed allocated capacity, constructed as new FixedList<T>(capacity). Add grows its live prefix but cannot reallocate: exceeding capacity
panics. Use List<T> when automatic growth is needed. Views cover only live elements and share
storage; ToArray copies them.
Inherits from object. Follow these links for inherited members.
Members
sizefield
public native readonly int32 sizeThe number of live elements; valid element indices are [0, size). Capacity is not part of
the readable range.
thisindexer-getter
public get this(int32 index) : TReads or replaces a live element at a zero-based index. An index outside [0, size) panics.
Replacing an element does not change the collection size.
thisindexer-setter
public set this(int32 index, T value) : voidReads or replaces a live element at a zero-based index. An index outside [0, size) panics.
Replacing an element does not change the collection size.
Addmethod
public fn Add(T value) : voidAppends one value, increasing size. Panics when no capacity remains.
Truncatemethod
public fn Truncate(int32 newSize) : voidShrinks the live prefix to newSize, which must be between zero and the current size. It
cannot grow the list and retains allocated capacity.
ToSpanmethod
public fn ToSpan() : Span<T>Borrows a mutable view of the current live elements without copying. The view has a fixed length. Writes affect shared storage; it does not follow a later collection reallocation.
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.
ToReadOnlySpanmethod
public fn ToReadOnlySpan() : ReadOnlySpan<T>Borrows the current live elements without copying or permitting writes through this view. Other aliases can still mutate the storage; the view does not follow a later reallocation.
Slicemethod
public fn Slice(int32 start, int32 len) : Span<T>Borrows a mutable window [start, start + len). Negative arguments or a range outside the
live elements panic. An empty slice at size is valid.
ToArraymethod
public fn ToArray() : T[]Copies the live elements into a separate dense array. Reference elements retain their object identities; the objects are not cloned.
AddRangemethod
public fn AddRange(scoped ReadOnlySpan<T> items) : voidAppends the source elements in order. Enough unused capacity must be available or the operation panics; do not rely on rollback of earlier appends on failure.
Clearmethod
public fn Clear() : voidRemoves all live elements while keeping allocated capacity.
RemoveLastmethod
public fn RemoveLast() : voidRemoves the last live element. Panics if the list is empty.
RemoveRangemethod
public fn RemoveRange(int32 index, int32 count) : voidRemoves a nonnegative count at an in-bounds index and shifts the surviving tail left. A
zero-length range at size is valid; invalid ranges panic.
constructorconstructor
public constructor (int32 capacity = 0)Provided by the compiler.