Suppose I have a base class A and a derived class B. B's constructor calls the constructor of A, in which I call a function, say func
to do some type-dependent thing. I mean, I have a do-nothing func
for A and override this method in B.
My problem:
In the very phase of construction of B, that is, in the constructor of A, what is the type of the object? While, I think it's A. But I'm not sure. If it is A, I'm always calling A's func
right? Regardless of the type of the object I want to construct.
In VS, in B's constructor, I see the type for "this" is "B". While I step into and in A's constructor, I see type for "this" "A".