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.
Searches a sorted array for the specified element or for the insert position of the 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.
Searches a sorted array for an element or an insert position for an element. The array is assumed to be pre-sorted according to cmp.
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.
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning true if an element matching needle is found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning a count of the number of elements matching needle. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning a count of the number of elements where pred returns true.
Check if the given array ends with the given suffix
Linear search in an array
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning the index of the first element that compares equal to the next element in the sequence. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning the index of the first element where pred returns true.
Performs a parallel linear scan of setA and setB from [0 .. N$(RP) where N = min(setA.length, setB.length), returning true if setA includes all elements in setB and false if not. Both setA and setB are required to be sorted, and duplicates in setB require an equal number of duplicates in setA. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of haystack from [0 .. haystack.length$(RP), returning the index of the first element matching needle, or haystack.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a parallel linear scan of arr and arr_against from [0 .. N$(RP) where N = min(arr.length, arr_against.length), returning the index of the first element in arr which does not match the corresponding element in arr_against or N if no mismatch occurs. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Remove the given prefix from the given array.
Remove the given suffix from the given array.
Performs a linear scan of haystack from $(LP)haystack.length .. 0], returning the index of the first element matching needle, or haystack.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of haystack from $(LP)haystack.length .. 0], returning the index of the first element where pred returns true.
Check if the given array starts with the given prefix
Collection of utilities to search within arrays and buffers.
All functions in this module must never mutate their arguments and must never allocate new memory each call. Some may keep internal static GC buffers if required by algorithm.
Based on tango.core.Array module from Tango library.