bsearch

Performs a binary search of buf, returning true if an element equivalent to pat is found. Comparisons will be performed using the supplied predicate or '<' if none is supplied.

  1. bool bsearch(Elem[] buf, Elem pat, Pred2E pred)
    version(TangoDoc)
    bool
    bsearch
  2. template bsearch(Buf, Pat)
  3. template bsearch(Buf, Pat, Pred)

Parameters

buf Elem[]

The sorted array to search.

pat Elem

The pattern to search for.

pred Pred2E

The evaluation predicate, which should return true if e1 is less than e2 and false if not. This predicate may be any callable type.

Return Value

Type: bool

True if an element equivalent to pat is found, false if not.

Meta