Skip to content

Conversation

eisenwave
Copy link
Member

Recently, it was really difficult for me to find out what happens when you transparently replace a subobject. [basic.life] p9 does not elaborate on this; the relevant parts are in [intro.object] p2.

Namely, the containing object is kept alive if the conditions are met and can be used to access the new subobject. A new note highlights this behavior and links back to [intro.object].

Furthermore, [basic.life] Example 3 is currently ill-formed (fixed by this PR) because it contains c1 = c2; at a top level, which should be taking place in a function body. The example is further expanded by two lines that demonstrate how a containing object survives when transparent replacement of one of its subobjects takes place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant