Merge pull request #6032 from RazvanN7/Issue_18230

Fix Issue 18230 - multiwayUnion sets wrong pred lambdas
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-01-16 23:10:54 +01:00 committed by GitHub
commit 17fbc92d59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -949,7 +949,8 @@ See also: $(LREF multiwayMerge)
auto multiwayUnion(alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
{
import std.algorithm.iteration : uniq;
return ror.multiwayMerge.uniq;
import std.functional : not;
return ror.multiwayMerge!(less).uniq!(not!less);
}
///
@ -980,6 +981,15 @@ auto multiwayUnion(alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
[ 7 ],
];
assert(equal(multiwayUnion(b), witness));
double[][] c =
[
[9, 8, 8, 8, 7, 6],
[9, 8, 6],
[9, 8, 5]
];
auto witness2 = [9, 8, 7, 6, 5];
assert(equal(multiwayUnion!"a > b"(c), witness2));
}
/**