class Test {
public Test() {
DoSomething();
}
public Test(int count) : this() {
DoSomethingWithCount(count);
}
public Test(int count, string name) : this(count) {
DoSomethingWithName(name);
}
}
有没有办法在C++中做到这一点?
我尝试调用类名并使用'this'关键字,但都失败了。
this
或auto
将是未来重构目的的有趣关键字。 - sergiol