Hi,
I just do it directly with the S struct, why can't I filter with partial? (#line 1)
import std.stdio, std.functional : partial;
void main()
{
alias foo = partial!(S.filter, nums);
foo('t').writeln; // okay
#line 1
//foo!(true)('t').writeln; //compile error
S.filter!true(nums, 'T').writeln; // alternative
}
struct S
{
import std.algorithm : F = filter;
static auto filter(bool isEnd = false)(string[] str, char chr)
{
static if (isEnd)
{
alias pred = s => s[$-1] == chr;
} else {
alias pred = s => s[0] == chr;
}
return str.F!pred;
}
}
SDB@79