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 v0.6.0-preview.1+4dde68eca4014e9b19e7d7ad0fdae6b2036be640.