Intersection

Produces a $(D_PSYMBOL Set) that containing elements of Sets[0] that are also elements of all other sets in Sets.

template Intersection (
Sets...
) if (
allSatisfy!(ApplyLeft!(isInstanceOf, Set), Sets)
) {}

Members

Aliases

Intersection
alias Intersection = Set!()
Undocumented in source.
Intersection
alias Intersection = Set!(Filter!(FilterImpl, Sets[0].Seq))
Undocumented in source.

Parameters

Sets

List of $(D_PSYMBOL Set) instances.

Return Value

Set-theoretic intersection of all Sets.

Examples

alias S1 = Set!(2, 5, 8, 4);
alias S2 = Set!(3, 8, 4, 1);
static assert(Intersection!(S1, S2).Seq == AliasSeq!(8, 4));

static assert(Intersection!(S1).Seq == AliasSeq!(2, 5, 8, 4));
static assert(Intersection!().length == 0);

See Also

$(D_PSYMBOL Set).

Meta