File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 36603660lifetime of the new object has started, can be used to manipulate the new
36613661object.
36623662
3663+ \begin {note }
3664+ Additionally, if the requirements in \ref {intro.object }
3665+ for the creation of subobjects are met,
3666+ once the lifetime of the new object has started,
3667+ the containing object of the original object
3668+ can be used to manipulate the new object.
3669+ \end {note }
36633670\begin {example }
36643671\begin {codeblock }
36653672struct C {
36773684 return *this;
36783685}
36793686
3680- C c1;
3681- C c2;
3682- c1 = c2; // well-defined
3683- c1.f(); // well-defined; \tcode {c1} refers to a new object of type \tcode {C}
3687+ void g() {
3688+ C c1;
3689+ C c2;
3690+ c1 = c2; // well-defined
3691+ c1.f(); // well-defined; \tcode {c1} refers to a new object of type \tcode {C}
3692+ new (&c1.i) int(42); // well-defined
3693+ int j = c1.i; // well-defined
3694+ }
36843695\end {codeblock }
36853696\end {example }
36863697\begin {note }
You can’t perform that action at this time.
0 commit comments