Are simple type variables objects in C++?
int x = 0;
Obviously, that depends on the definition of the object. So would x
be object in this case? It may not be defined by the standard in any way, but please do claim so if you are sure that this is either object or it is not.
Yes (object in the standard are simply a region of storage -- 1.8/1)
An object is a region of storage. [Note: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. ] An object is created by a definition, by a new-expression_ or by the implementation when needed.
And for variable (3/4)
A name is a use of an identifier that denotes an entity or label. A variable is introduced by the declaration of an object. The variable's name denotes the object.
For the curious, the definition is inherited from C (with modifications needed for C++). The C 90 Standard states:
object: A region of data storage in the execution environment, the contents of which can represent values.