作为C#开发人员,我习惯于运行构造函数:
class Test {
public Test() {
DoSomething();
}
public Test(int count) : this() {
DoSomethingWithCount(count);
}
public Test(int count, string name) : this(count) {
DoSomethingWithName(name);
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法在C++中执行此操作?
我尝试调用类名并使用'this'关键字,但都失败了.