There is a problem with inconsistency in the terminology used the C++
standards. For example the word "contains" .
(1) An object of array type, which nobody around can even acknowledge ,
--You're still hung up on the whole "array objects are not modifiable
--thing, but its contained sub-objects are". I'm sorry - the standard
--does mean that expressions of array type, which refer to a region of
--memory which contains the sub-objects, is not modifiable, but the
--individual sub-objects are modifiable. It is making a statement about
--how expressions of array type are not modifiable. It is not making a
--statement about how the entire region of memory is not modifiable but
--the sub-pieces, the array elements, are.
So you are saying that the standard is worng to say the "object" is non
modifiable?
It should say the expression is non modifiable or something like that?
is
described as some object that "contains" sub objects of element types.
I can understand this *concept* sure but there is no physical object in
memory that contains sub-objects.
-- class Foo { int x; };
-- Foo foo;
--"foo" is a physical object in memory. "x" is a physical (sub-)object
--in memory. Both take up a piece of memory. The region of memory of "x"
--is a sub-region of the region of memory of "foo". That is, the region
--of memory of "x" is contained within the region of memory of "foo".
--Put another way, we are guaranteed that:
-- assert( (char*)&foo <= (char*)&x );
-- assert( (char*)&x + sizeof(x) <= (char*)&foo + sizeof(foo) );
--(Optionally, that may require std::less. I don't care enough to look
--up the arcane rules of if you can do pointer comparisons for pointers
--obtained from the same complete object.)
I dont see what you are trying to say here. x is a sub-object of Foo?
class Foo{}
class Bar
ublic Foo{}
Bar b;
Does b have a sub-object of type Foo?
Is this also a sub-object but in a different way?
(2) An object(of class type) does not contain member functions. LOL
This must be a joke because an array object can "contain" sub objects , as
a
concept but an object(of class type) cannot "contain" memeber function, as
a
concept.
--Yep. The C++ source code of the member functions neither appears
--inside the declaration nor definition of the object.
The member function is declared inside the the class definiton.
--Also, on
--basically every implementation ever, the compiled assembly of the
--member function does not exist inside the region of memory of the
--object. Finally, the object does not "own" the member function - you
--can have member functions without an object. Thus, the word "contains"
--does not apply to objects and their member functions.
A member function is invoked on an object.
What do you mean by a member function without an object. Please give an
example.
The problem is that people can interpret the standards in different ways,
and when the majority of people in a given group come to a consensus about
the interpreted meaning, that is the defined meaning.
But a technical standard should define what it is written to define , not
a
clique of people who have a common concencus of its interpretation.
--Well, we're in agreement on that point. All of us just think that you
--are wrong in your readings and interpretations.
Glad your in the majority, bet it makes you feel good