Сообщение Re[108]: Когда это наконец станет defined behavior? от 22.08.2023 11:21
Изменено 22.08.2023 11:24 so5team
V>Приведена выдержка из стандарта, в которой определяется что суть есть "object creation". И как после нее можно заявлять о потере смысла? Она и определяет смысл. Она есть смысл.
Или проблема в том, что все это раскидано в разных кусках стандарта. Которые нужно увязать друг с другом, чтобы получить общую картину.
V>Какой еще lifetime
Или нужно просто посмотреть на чуть более расширенную цитату (https://timsong-cpp.github.io/cppwp/basic.memobj#intro.object-1):
The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is created by a definition, by a new-expression ([expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union, or when a temporary object is created ([conv.rval], [class.temporary]). An object occupies a region of storage in its period of construction ([class.cdtor]), throughout its lifetime, and in its period of destruction ([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]
The properties of an object are determined when the object is created. An object can have a name ([basic.pre]). An object has a storage duration ([basic.stc]) which influences its lifetime ([basic.life]). An object has a type ([basic.types]).
[Note 2: Some objects are polymorphic ([class.virtual]); the implementation generates information associated with each such object that makes it possible to determine that object's type during program execution. — end note]
Т.е. в разделе про создание объектов уже ссылаются на lifetime.
V>Приведена выдержка из стандарта, в которой определяется что суть есть "object creation". И как после нее можно заявлять о потере смысла? Она и определяет смысл. Она есть смысл.
Или проблема в том, что все это раскидано в разных кусках стандарта. Которые нужно увязать друг с другом, чтобы получить общую картину.
V>Какой еще lifetime
Или нужно просто посмотреть на чуть более расширенную цитату (https://timsong-cpp.github.io/cppwp/basic.memobj#intro.object-1):
The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is created by a definition, by a new-expression ([expr.new]), by an operation that implicitly creates objects (see below), when implicitly changing the active member of a union, or when a temporary object is created ([conv.rval], [class.temporary]). An object occupies a region of storage in its period of construction ([class.cdtor]), throughout its lifetime, and in its period of destruction ([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]
The properties of an object are determined when the object is created. An object can have a name ([basic.pre]). An object has a storage duration ([basic.stc]) which influences its lifetime ([basic.life]). An object has a type ([basic.types]).
[Note 2: Some objects are polymorphic ([class.virtual]); the implementation generates information associated with each such object that makes it possible to determine that object's type during program execution. — end note]
Т.е. в разделе про создание объектов уже ссылаются на lifetime.