intersection

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

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 $(DDOX_NAMED_REF range.sortingpredicate, `sorting predicate`).

intersection
(
alias pred = null
Range
Rs...
)
(
Range range
,
)
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)
)
)

Parameters

pred

unary transformation or binary comparator

range
Type: Range

the range to inspect

values
Type: Rs

ranges or single values to exclude

Return Value

Type: auto

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

Meta

Since

0.0.1