binarySearch

nint binarySearch<T>(const T[] this, in T value, delegate int(in T left, in T right, sizeof(T)) compare, sizeof(T))

Searches a sorted array for a value.

Returns

The zero-based index of the matching item, or -1 when no match exists.

Parameters

const
this
in T
value

The item to find.

delegate int(in T left, in T right, sizeof(T))
compare

Compares an array item with value using the same ordering used to sort the array.

nuint
sizeof(T)

Generated with campc 0.14.0-preview.1.