C++ Logo


Advanced search

[std-proposals] Static-layout types

From: Lauri Vasama <wg21_at_[hidden]>
Date: Sat, 23 Apr 2022 13:04:40 +0300

I am looking for feedback on a proposal which concerns a new property of
types which I call static layout types. In short these are types which
layouts do not vary between objects of type. In practice it excludes
types employing virtual inheritance.


I included some wording, but it undoubtedly requires more work. I am
also not yet decided on whether the larger concept of /static-//layout
type/ is really needed, or if /static//-layout class/ is sufficient.

Beyond offsetof, there are some potential future features which would
benefit from the concept of static layout, such as deriving an offset
from a pointer-to-data-member of a /static-layout class/, or deriving a
reference to an object from a reference to a member subobject and a
matching pointer-to-data-member, as was discussed last december [1].


Received on 2022-04-23 10:04:47