Fix std.algorithm.setIntersection documentation

This commit is contained in:
Jakob Ovrum 2013-12-16 17:04:00 +09:00
parent 09fc88f719
commit e569476df9

View file

@ -10869,9 +10869,9 @@ unittest
} }
/** /**
Lazily computes the intersection of two or more input ranges $(D Lazily computes the intersection of two input ranges $(D
rs). The ranges are assumed to be sorted by $(D less). The element rs). The ranges are assumed to be sorted by $(D less). The element
types of all ranges must have a common type. types of both ranges must have a common type.
*/ */
struct SetIntersection(alias less = "a < b", Rs...) struct SetIntersection(alias less = "a < b", Rs...)
if (allSatisfy!(isInputRange, Rs)) if (allSatisfy!(isInputRange, Rs))
@ -10957,6 +10957,7 @@ if (allSatisfy!(isInputRange, Rs))
return typeof(return)(ranges); return typeof(return)(ranges);
} }
/+ setIntersection doesn't yet support more than two inputs
/// ///
unittest unittest
{ {
@ -10967,6 +10968,16 @@ unittest
assert(equal(setIntersection(a, b), [1, 2, 4, 7][])); assert(equal(setIntersection(a, b), [1, 2, 4, 7][]));
assert(equal(setIntersection(a, b, c), [1, 4, 7][])); assert(equal(setIntersection(a, b, c), [1, 4, 7][]));
} }
+/
///
unittest
{
int[] a = [ 1, 2, 4, 5, 7, 9 ];
int[] b = [ 0, 1, 2, 4, 7, 8 ];
assert(equal(setIntersection(a, a), a));
assert(equal(setIntersection(a, b), [1, 2, 4, 7][]));
}
/** /**
Lazily computes the difference of $(D r1) and $(D r2). The two ranges Lazily computes the difference of $(D r1) and $(D r2). The two ranges