- Joined
- Jun 29, 2022
- Messages
- 28
- Reaction score
- 0
As a C# developer, I'm used to iterating through constructors: I've been reading this article online from scaler topics and I wanted to know, Is it possible to achieve this in C++? Both invoking the Class name and using the 'this' keyword fail.
Code:
class Test {
public Test() {
DoSomething();
}
public Test(int count) : this() {
DoSomethingWithCount(count);
}
public Test(int count, string name) : this(count) {
DoSomethingWithName(name);
}
}