diff --git a/source/basic.tex b/source/basic.tex index 9524265f81..4d21f2303e 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -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 { @@ -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}