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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3660,6 +3660,13 @@
lifetime of the new object has started, can be used to manipulate the new
object.

\begin{note}
Additionally, if the requirements in \ref{intro.object}
for the creation of subobjects are met,
once the lifetime of the new object has started,
the containing object of the original object
can be used to manipulate the new object.
\end{note}
\begin{example}
\begin{codeblock}
struct C {
Expand All @@ -3677,10 +3684,14 @@
return *this;
}

C c1;
C c2;
c1 = c2; // well-defined
c1.f(); // well-defined; \tcode{c1} refers to a new object of type \tcode{C}
void g() {
C c1;
C c2;
c1 = c2; // well-defined
c1.f(); // well-defined; \tcode{c1} refers to a new object of type \tcode{C}
new (&c1.i) int(42); // well-defined
int j = c1.i; // well-defined
}
\end{codeblock}
\end{example}
\begin{note}
Expand Down
Loading