Product Type
Array
An ordered, random-access collection.
type Array<Element: SemiRegular>: SemiRegular
Members
Bindings
var storage: DynamicBuffer<Int, Element>
Functions
fun deinit() { sink }
Deinitializes self.
fun is_empty() -> Bool
Returns true if self is empty.
fun capacity() -> Int
The number of elements that can be stored in the array before new storage must be allocated.
fun reserve_capacity(_ n: Int) { inout }
Reserves enough space to store n elements in self.
fun with_mutable_contiguous_storage<E, T: Movable>(_ action: inout [E] (PointerToMutable<Element>) inout -> T) -> T { inout }
Calls action with a pointer to the start of the array's mutable contiguous storage.
fun append(_ source: sink Element) { inout }
Adds a new element at the end of the array.
fun insert(_ source: sink Element, at index: Int) { inout }
Inserts source at index.
fun remove(at index: Int) -> Element { inout }
Removes and returns the element at index.
fun remove_all(keeping_capacity keep_capacity: Bool) { inout }
Removes al elements in the array, keeping existing storage if keep_capacity is true.
fun pop_last() -> Optional<Element> { inout }
Removes and returns the last element of the array.
fun reverse() { inout }
Reverses the elements of self in place.
Subscripts
property contiguous_storage: Pointer<Element> { let }
Projects a pointer to the start of the array's contiguous storage.
subscript pointer_to_element(at position: Int): PointerToMutable<Element> { let }
Projects the address of the element at position.