import std.stdio;
template Person() {
string name;
void print() {
writeln(name);
}
}
void main() {
string name;
mixin Person a;
name = "name 1";
writeln(name);
a.name = "name 2";
print();
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266035.html