Function intersection

Creates a range of unique values that are included in all given ranges

auto auto intersection(alias pred, Range, Rs...) (
  Range range,
  Rs values
)
if (from.std.range.isInputRange!Range && (from.bolts.traits.isNullType!pred || from.bolts.traits.isUnaryOver!(pred, from.std.range.ElementType!Range) || from.bolts.traits.isBinaryOver!(pred, from.std.range.ElementType!Range)));

The pred defaults to null. If a unary predicate is passed in, then a transformation will be appled to each element before comparing. If a binary predicate is passed in, it will determine equality of elements.

If pred is null or unary, and the range is sortable or is sorted, an optimized linear algorithm will be used instead using the range's sorting predicate.

Parameters

NameDescription
pred unary transformation or binary comparator
range the range to inspect
values ranges or single values to exclude

Returns

New array of filtered results. If Rs is empty, then empty range is returned

Since

0.0.1