Base class ctor

If i have 3 classes to inherit as follows

And the following line included in main function


the copy ctor of b when called from ctor of c is executing code i cannot see while debugging and is creating a new empt object of type a

The only way i can find to work around this problem is to detect an empty type a

object before executing code in type a ctor

one must be familiar with the type of problem i am reffering to
What are you trying to do with that code exactly? I'm not sure what your problem is or how it relates to what you are trying to accomplish.
Posting a minimal, compilable code snippet that illustrates the problem would be beneficial.

If class B inherits from class A, then yes, when a B is constructed it's A subobject will also be created.

c(b(a())); <- doesn't do anything useful.
Topic archived. No new replies allowed.