Title
Definition of "object"
Status
open
Section
6.7.2 [intro.object]
Submitter
Roman Jasmann

Created on 2024-09-22.00:00:00 last changed 1 month ago

Messages

Date: 2024-10-16.11:25:35

Prior to P0137R1, the term "object" was defined to be "a region of storage". Currently, the term "object" appears to be missing a definition. The submitter suggests to restore wording similar to "An object is a region of storage associated with a type." and disagrees with the resolutions suggested below.

Possible resolution (option 1):

Change in 6.7.2 [intro.object] paragraph 1 as follows:

An object is a logical element of the execution model of the abstract machine (4.1.2 [intro.abstract]). The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object object is created by a definition (6.2 [basic.def]), by a new-expression (7.6.2.8 [expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union (11.5 [class.union]), or when a temporary object is created (7.3.5 [conv.rval], 6.7.7 [class.temporary]). An object occupies a region of storage in its period of construction (11.9.5 [class.cdtor]), throughout its lifetime (6.7.3 [basic.life]), and in its period of destruction (11.9.5 [class.cdtor]). [Note 1: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note]

Possible resolution (option 2):

Change in 6.7.2 [intro.object] paragraph 1 as follows:

An object is an element of the execution representation of the program in the abstract machine (4.1.2 [intro.abstract]) that represents an instance of an object type. The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object object is created by a definition (6.2 [basic.def]), by a new-expression (7.6.2.8 [expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union (11.5 [class.union]), or when a temporary object is created (7.3.5 [conv.rval], 6.7.7 [class.temporary]). An object occupies a region of storage in its period of construction (11.9.5 [class.cdtor]), throughout its lifetime (6.7.3 [basic.life]), and in its period of destruction (11.9.5 [class.cdtor]). [Note 1: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. —end note]
History
Date User Action Args
2024-09-22 00:00:00admincreate