mirror of
https://github.com/dlang/phobos.git
synced 2025-05-09 21:11:57 +03:00
Update iteration.d UT comment
This commit is contained in:
parent
b26bcb70fb
commit
4150b2bb84
1 changed files with 2 additions and 2 deletions
|
@ -1116,11 +1116,11 @@ if (is(typeof(unaryFun!predicate)))
|
||||||
|
|
||||||
int[] arr = [ 1, 2, 3, 4, 5 ];
|
int[] arr = [ 1, 2, 3, 4, 5 ];
|
||||||
|
|
||||||
// Sum all elements
|
// Filter below 3
|
||||||
auto small = filter!(a => a < 3)(arr);
|
auto small = filter!(a => a < 3)(arr);
|
||||||
assert(equal(small, [ 1, 2 ]));
|
assert(equal(small, [ 1, 2 ]));
|
||||||
|
|
||||||
// Sum again, but with Uniform Function Call Syntax (UFCS)
|
// Filter again, but with Uniform Function Call Syntax (UFCS)
|
||||||
auto sum = arr.filter!(a => a < 3);
|
auto sum = arr.filter!(a => a < 3);
|
||||||
assert(equal(sum, [ 1, 2 ]));
|
assert(equal(sum, [ 1, 2 ]));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue