If you pass an instance of B
to the C
constructor that takes an A
by value, the B
instance will be sliced, and just the A
part will remain. So :
would it copy it's A part data in the class?
this.
So, specifically, there is no way to turn the C::a
member back into a B
instance with the same value for z
as the original B
instance - that information has been lost during the (irreversible) slicing operation.