Unique

Evaluates to an AliasSeq which contains no duplicate elements.

Unique takes a binary template predicate that it uses to compare elements for equality. If the predicate is true when an element in the given AliasSeq is compared with an element with a lower index, then that element is not included in the result (so if any elements in the AliasSeq are considered equal per the predicate, then only the first one is included in the result).

Note that the binary predicate must be partially instantiable, e.g.

alias PartialCmp = Cmp!(Args[0]);
enum same = PartialCmp!(Args[1]);

Otherwise, it won't work.

template Unique (
alias Cmp
Args...
) {}

See Also

Meta