class A {
int x;
};
class B : public A {
int y;
};
B b;
I know b is considered a complete object of B and the object that B contains is a sub-object of A.
But someone pointed me to this,
Paragraph 3, of C++ Standard 1.8
(1.8/3) For every object x, there is some object called the complete
object of x, determined as follows: — If x is a complete object, then
x is the complete object of x. — Otherwise, the complete object of x
is the complete object of the (unique) object that contains x.
In this, I’m finding the wording the very confusing with all those xs all over the place, Can you explain this with my example?
bis the complete object ofb,x,yand theAsubobject ofb.