Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[basic.life] Reference [intro.object] in transparent replacement note and improve example #7331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eisenwave
Copy link
Contributor

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