Информация об изменениях

Сообщение Re[25]: Оставаться в С++ или уходить? от 01.10.2019 7:25

Изменено 01.10.2019 7:26 night beast

Re[25]: Оставаться в С++ или уходить?
Здравствуйте, Stanislav V. Zudin, Вы писали:

SVZ>>>А можно ссылку на Стандарт, а то что-то я отстал от жизни.


NB>>

NB>>9.2.15 Nonstatic data members of a (non-union) class with the same access control (Clause 11) are allocated so that later members have higher addresses within a class object. The order of allocation of non-static data members with different access control is unspecified (11). Implementation alignment requirements might cause two adjacent members not to be allocated immediately after each other; so might requirements for space for managing virtual functions (10.3) and virtual base classes (10.1).


SVZ>Я всегда считал, что выделенное означает паддинг, а не перестановку мемберов местами.


это и означает паддинг
тут основное

data members of a (non-union) class with the same access control (Clause 11) are allocated so that later members have higher addresses within a class object.

то есть в пределах одного доступа стандарт гарантирует последовательное размещение.
Re[25]: Оставаться в С++ или уходить?
Здравствуйте, Stanislav V. Zudin, Вы писали:

SVZ>>>А можно ссылку на Стандарт, а то что-то я отстал от жизни.


NB>>

NB>>9.2.15 Nonstatic data members of a (non-union) class with the same access control (Clause 11) are allocated so that later members have higher addresses within a class object. The order of allocation of non-static data members with different access control is unspecified (11). Implementation alignment requirements might cause two adjacent members not to be allocated immediately after each other; so might requirements for space for managing virtual functions (10.3) and virtual base classes (10.1).


SVZ>Я всегда считал, что выделенное означает паддинг, а не перестановку мемберов местами.


это и означает паддинг
тут основное

data members of a (non-union) class with the same access control (Clause 11) are allocated so that later members have higher addresses within a class object.

то есть в пределах одного доступа стандарт гарантирует последовательное (с возможным паддингом) размещение.