bcontains

Searches a sorted array for the specified element. The array is assumed to be pre-sorted in ascending order, the search will not work properly if it is not. If T is a class or struct, comparison is performed using T.opCmp(). Otherwise, elements of T are compared using ">" and ">=" or, if T is compatible to size_t (which includes ssize_t, the signed version of size_t), by calculating the difference.

Template params: T = type of array element

bool
bcontains
(
T
)
(
T[] array
,)

Parameters

array T[]

array to search

match T

element to search for

Return Value

Type: bool

true if the element was found in the array

In: See bsearch for input constraints

Meta