P
Paul
Ulrich Eckhardt said:Aw, c'mon, it lists all possible things an object can contain. Is a member
function among those?
Read up on the so-called "empty baseclass optimization", it allows objects
to effectively use no additional storage.
You quoted the definition of a subobject elsewhere already, it is an
object and thus all restrictions of what constitutes an object apply. Also
note that the above describes classes, not objects, in other words this is
not an argument for or against your case.
This is what the standard gives as a definition of a member subobject.
A class is the definition of an object type therefore I think the standards
are quite correct to define member subobjects as a class.
If you disagree then you disagree with the standards.
You shunned the above standards definition stating it was referring toRight, exactly that is what you do.
I don't think anybody does. What people keep telling you is that there is
no containment involved in the object/class relationship.
classes an not objects re:
"Also
note that the above describes classes, not objects, in other words this is
not an argument for or against your case."
If the standard defines a member subobject in the context of a class it
reinforces my point that classes and objects are not completely unrelated.
Class/object confusion, read it again.
A class is the definiton of an object, there is no confusion in my mind.
I don't know what your interpretation is but you seem to imply these are two
completely different things.
This does not imply that the function is contained within the object.
Also, not every function call uses dynamic dispatch and requires any
information about the type in the object.
This shows clearly that , in some cases, a pointer to a member function is
actually stored within an object.
The argument is not that functions are stored within an object, the argument
is that member functions are a part of an object as they are defined to be
so in the objects class.
I'm not sure what this is supposed to demonstrate. Other than the alreadyYou can consider it part of an object. This distorted view will work in a
few cases, but in other cases it will fail to correctly explain things,
example:
Base b;
Derived d;
b = d;
b.some_function();
Will the last function call invoke Base::some_function() or
Derived::some_function()? If the member functions are part of the object,
copying the object will also copy the functions. However, it doesn't, so
this is something your distorted view doesn't explain. I'm not settling
for your sub-par explanations, and you shouldn't either.
well known fact that the actual function code is not stored within an
objects region of storage.