Arrays
arr
Overload | Description |
---|---|
arr<T>() -> Array<'T> |
Creates an empty Array<'T>
|
reserve
Overload | Description |
---|---|
reserve<T>(arr: @Array<'T>, size: Int) -> () |
Allocates enough memory in arr to contain size elements
|
len
Overload | Description |
---|---|
len<T>(arr: @Array<'T>) -> Int |
Returns the length of arr
|
capacity
Overload | Description |
---|---|
capacity<T>(arr: @Array<'T>) -> Int |
Returns the allocated size inside of arr
|
push
Overload | Description |
---|---|
push<T>(arr: @Array<'T>, elem: 'T) -> () |
Appends elem to the end of arr
|
pop
Overload | Description |
---|---|
pop<T>(arr: @Array<'T>) -> () |
Remove the last element of arr if it exists
|
insert
Overload | Description |
---|---|
insert<T>(arr: @Array<'T>, elem: 'T, pos: Int) -> () |
Inserts elem into arr at the position pos
|
remove
Overload | Description |
---|---|
remove<T>(arr: @Array<'T>, pos: Int) -> () |
Remove pos 'th element of arr
|
set
Overload | Description |
---|---|
set<T>(arr: @Array<'T>, elem: 'T, pos: Int) -> () |
Sets the pos 'th element of arr to elem
|