bsubset

Checks if array B is a subset of array A. Array A is assumed to be pre-sorted in ascending order. Array B doesn't need to be sorted and might have duplicate elements. It checks if array A contains each item of array B using binary search. 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.

If both of the arrays are sorted in the same way and don't contain different number of duplicate items, see mismatch.

Template params: T = type of array element

bool
bsubset
(
T
)
(
T[] a
,
T[] b
)

Parameters

a T[]

array A

b T[]

array B

Return Value

Type: bool

false if there is any item of array B, which is not an item of array A

In: See bsearch for input constraints

Meta