d is a derived. Therefore,
d is a base.
b is a base.
Therefore, on line 4, you are setting a base equal to something that is a base. That makes sense, right?
To elaborate, you are setting the value of
b to be the same as the value of that part of
d that is a base. It is possible to set the value of
b to be equal to
d, because
d contains everything needed to completely set the value of
b. (
d also contains other stuff, but that's ignored).
Now look at the opposite case:
1 2 3 4
|
derived d;
base b;
d = b;
|
Now, you are trying to set the value of a derived, to something that is not a derived.
b does not contain everything necessary to set the complete value of
d, so this operation is illegal.
Does that make sense?