ReadOnlySlice<T>
Struct · built-in type
struct ReadOnlySlice<T>A read-only view of elements: a Slice, an array, or a constant (const ReadOnlySlice<int> Primes = [2, 3, 5];,
Enum<T>.Values, embed("*.txt")).
A function that takes a ReadOnlySlice<T> accepts arrays, slices and constants alike. It can also be a
parameter of a thread function when its elements can be copied between threads (the thread gets its own copy).
Fields
Section titled “Fields”| Name | Description |
|---|---|
Length |
The number of elements. |
Length
Section titled “Length”int LengthThe number of elements.
Methods
Section titled “Methods”| Name | Description |
|---|---|
ToArray |
A new array with the elements. |
Ptr |
A pointer to the first element (unsafe). |
ToArray
Section titled “ToArray”T[] ToArray()A new array with the elements.
T* Ptr()A pointer to the first element (unsafe).