Array
Parameters
[DType; nelts]
Represents a contiguous block of memory housing nelts
elements of type DType
.
Array is a low level data type that must be used with caution. When creating an array if an initial_value
is not passed to the contructor the block of memory allocated will be zero-initialized. This could lead to segmentation faults if not used with care. For a safer alternative consider using a List.
graph BT
N1["Array[DType; nelts]"] -->|inherits| N2["Length"];
Characteristics
Quality | Value |
---|---|
Inherits | Length |
Extends | N/A |
Decorators | #extern; |
Is enum | false |
Is sealed | false |
Is extern | true |
Subscript
[s Self, index ULen] -> @DType
Methods
construct
construct (s Self, initial_value @DType?) -> Self
get_element_ptr_unchecked
#Gambol.function.alwaysinline
get_element_ptr_unchecked (s Self, idx ULen) -> PointerToVariable[DType]
get_element_ptr
#Gambol.function.alwaysinline
get_element_ptr (s Self, index Len) -> PointerToVariable[DType]
get_unchecked
#Gambol.function.alwaysinline
get_unchecked (s Self, index ULen) -> @DType
set_unchecked
#Gambol.function.alwaysinline
set_unchecked (s Self, value @DType, index ULen) -> Nil
len
#Gambol.function.alwaysinline
#strict
len (s Self) -> Len
Binary Operators
=
#Gambol.function.alwaysinline
= (s Self, o Self) -> Self
is in
is in (s Self, value DType) -> Bool