Перенос страниц
This commit is contained in:
parent
4d57446057
commit
4c954c9186
129 changed files with 14 additions and 15 deletions
|
@ -0,0 +1,15 @@
|
|||
import std.algorithm;
|
||||
|
||||
T[] delegate(T[]) finder(T)(T x)
|
||||
if (is(typeof(x == x) == bool))
|
||||
{
|
||||
return delegate(T[] a) { return find(a, x); };
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
auto d = finder(5);
|
||||
assert(d([1, 3, 5, 7, 9]) == [ 5, 7, 9 ]);
|
||||
d = finder(10);
|
||||
assert(d([1, 3, 5, 7, 9]) == []);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue