Difference

Produces a $(D_PSYMBOL Set) that contains all elements of S1 that are not members of S2.

template Difference (
alias S1
alias S2
) if (
isInstanceOf!(Set, S1) &&
isInstanceOf!(Set, S2)
) {}

Members

Aliases

Difference
alias Difference = Set!()
Undocumented in source.
Difference
alias Difference = S1
Undocumented in source.
Difference
alias Difference = Set!(Filter!(Impl, S1.Seq))
Undocumented in source.

Parameters

S1

A $(D_PSYMBOL Set).

S2

A $(D_PSYMBOL Set).

Return Value

Set-theoretic difference of two sets S1 and S2.

Examples

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

See Also

$(D_PSYMBOL Set).

Meta