binarySearch

nint binarySearch<T: any>(const T[] this, in T value, delegate int(in T left, in T right) 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)
compare

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

nuint
sizeof(T)

Generated with campc 0.12.0-preview.1.