d的构闭包
struct FunctionObject {
string s;
this(string s) {
this.s = s;
}
auto opCall() {
import std.stdio : writeln;
s.writeln;
}
}
struct A
{
FunctionObject[] dg;
}
auto createDelegate(string s) {
return FunctionObject(s);
}
浙公网安备 33010602011771号