原文
import std;
template test(alias f) {
auto test(I)(I i) { return f(i); }
}
void main()
{
alias t = test!(x=>x+1);
1.t.writeln; //<--不编译.
1.test!(x=>x+1).writeln;
t(1).writeln;
}
局部符号
不能用作UFCS
函数.
d局部函数不能ufcs
阅读 94
2022-06-20
原文
import std;
template test(alias f) {
auto test(I)(I i) { return f(i); }
}
void main()
{
alias t = test!(x=>x+1);
1.t.writeln; //<--不编译.
1.test!(x=>x+1).writeln;
t(1).writeln;
}
局部符号
不能用作UFCS
函数.
相关推荐
精彩评论(0)