indexOf

Compile-time function to get the index of the give element.

Performs a linear scan, returning the index of the first occurrence of the specified element in the array, or U.max if the array does not contain the element.

size_t
indexOf
(
T
)
(
T[] arr
,)

Parameters

arr T[]

the array to get the index of the element from

element T

the element to find

Return Value

Type: size_t

the index of the element or size_t.max if the element was not found.

Meta