ListComparison

Undocumented in source.

Constructors

this
this(U reference, V list, double maxRelDiff)
Undocumented in source.

Members

Aliases

T
alias T = Unqual!Type
Undocumented in source.

Functions

common
T[] common()
Undocumented in source. Be warned that the author may not have intended to support it.
extra
T[] extra()
Undocumented in source. Be warned that the author may not have intended to support it.
missing
T[] missing()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

ListComparison should be able to get the missing elements

auto comparison = ListComparison!int([1, 2, 3], [4]);

auto missing = comparison.missing;

assert(missing.length == 3);
assert(missing[0] == 1);
assert(missing[1] == 2);
assert(missing[2] == 3);

ListComparison should be able to get the missing elements with duplicates

auto comparison = ListComparison!int([2, 2], [2]);

auto missing = comparison.missing;

assert(missing.length == 1);
assert(missing[0] == 2);

ListComparison should be able to get the extra elements

auto comparison = ListComparison!int([4], [1, 2, 3]);

auto extra = comparison.extra;

assert(extra.length == 3);
assert(extra[0] == 1);
assert(extra[1] == 2);
assert(extra[2] == 3);

ListComparison should be able to get the extra elements with duplicates

auto comparison = ListComparison!int([2], [2, 2]);

auto extra = comparison.extra;

assert(extra.length == 1);
assert(extra[0] == 2);

ListComparison should be able to get the common elements

auto comparison = ListComparison!int([1, 2, 3, 4], [2, 3]);

auto common = comparison.common;

assert(common.length == 2);
assert(common[0] == 2);
assert(common[1] == 3);

ListComparison should be able to get the common elements with duplicates

auto comparison = ListComparison!int([2, 2, 2, 2], [2, 2]);

auto common = comparison.common;

assert(common.length == 2);
assert(common[0] == 2);
assert(common[1] == 2);

Meta