1

Topic: std:: string

Created on a stack std:: string
Then I create object in  and I want that I std:: string was there we weed for a long time
How it correctly to make?
Thanks

2

Re: std:: string

semen.s.semen;
std:: string it is not copied/not  in std:: string on ?

3

Re: std:: string

Understood

4

Re: std:: string

semen.s.semen, on a stack you created one byte, and all remaining and so in a heap. smile

5

Re: std:: string

rdb_dev wrote:

semen.s.semen, on a stack you created one byte, and all remaining and so in a heap. smile

Depends from

6

Re: std:: string

rdb_dev wrote:

semen.s.semen, on a stack you created one byte, and all remaining and so in a heap. smile

At  it is used RVO so small lines are completely stored on a stack and only in case of shortage of storage of the built in variables storage in a heap is selected.

7

Re: std:: string

semen.s.semen wrote:

Created on a stack std:: string
Then I create object in  and I want that I std:: string was there we weed for a long time
How it correctly to make?
Thanks

Aggregation on value in this object.