原文
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
函数.
微信扫一扫
原文
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
函数.
相关推荐