toArray

Creates a single element dynamic array that slices val. This will not allocate memory in contrast to the 'val' expression.

T[]
toArray
(
T
)
(
ref T val
)

Parameters

val T

value to slice

Return Value

Type: T[]

single element dynamic array that slices val.

Examples

int x;
int[] arr = toArray(x);

Meta