26

Re: Whether correctly to return the link to a function parameter

Dimitry Sibiryakov wrote:

it is passed...
We do not create it on a stack.

I do not like to consider an implementation detail when it is not necessary for a reasoning on behavior of the program, but nevertheless assembly listing specifies in place selection on a stack.

27

Re: Whether correctly to return the link to a function parameter

wrote:

assembly listing specifies in place selection on a stack.

Yes, you are right.

28

Re: Whether correctly to return the link to a function parameter

wrote:

according to With ++ 15.2.6 + RVO

Any there (N) RVO is not present and cannot be.

29

Re: Whether correctly to return the link to a function parameter

petrav wrote:

it is passed...
Time of their life comes to an end when we quit function. Yes I understood. Accordingly if we return the link to transient object generated for a function parameter, with all aggravating...
It is necessary to understand why in my last example a line in a correct state.   the pointer, length of a line and the reserved size?

Without optimization you work as though wanted - 123.
The object temporary is created, remote. But the data that on a place.
Optimization removes __ transient object, and there is nothing to return)
Simply line with zero all structures is interpreted as empty.
Explicit . It is not necessary so to do.