In process function constructor(1) [0x7ff7b218bb20] move constructor, from [0x7ff7b218bb20] to [0x7ff7b218bb60] destructor() [0x7ff7b218bb20] move constructor, from [0x7ff7b218bb60] to [0x7ff7b218bb68] destructor() [0x7ff7b218bb60] ---vals:--- s addr:[0x7ff7b218bb68], val:[1] destructor() [0x7ff7b218bb68]
In process function constructor(1) [0x7ff7badabb20] move constructor, from [0x7ff7badabb20] to [0x7ff7badabb60] destructor() [0x7ff7badabb20] move constructor, from [0x7ff7badabb60] to [0x7ff7badabb68] destructor() [0x7ff7badabb60] In process1 function constructor(9) [0x7ff7badabb20] move constructor, from [0x7ff7badabb20] to [0x7ff7badabb48] destructor() [0x7ff7badabb20] move constructor, from [0x7ff7badabb48] to [0x7ff7badabb50] destructor() [0x7ff7badabb48] ---vals:--- s addr:[0x7ff7badabb68], val:[1] s1 addr:[0x7ff7badabb50], val:[9] destructor() [0x7ff7badabb50] destructor() [0x7ff7badabb68]
In process function constructor(1) [0x7ff7b144eb68] In process1 function constructor(9) [0x7ff7b144eb60] ---vals:--- s addr:[0x7ff7b144eb68], val:[1] s1 addr:[0x7ff7b144eb60], val:[9] destructor() [0x7ff7b144eb60] destructor() [0x7ff7b144eb68]
In process function constructor(1) [0x7ff7bc432b00] move constructor, from [0x7ff7bc432b00] to [0x7ff7bc432b60] destructor() [0x7ff7bc432b00] move constructor, from [0x7ff7bc432b60] to [0x7ff7bc432b68] destructor() [0x7ff7bc432b60] In process function constructor(3) [0x7ff7bc432b00] move constructor, from [0x7ff7bc432b00] to [0x7ff7bc432b40] destructor() [0x7ff7bc432b00] In process function constructor(4) [0x7ff7bc432b00] move constructor, from [0x7ff7bc432b00] to [0x7ff7bc432b30] destructor() [0x7ff7bc432b00] ---vals:--- s1 addr:[0x7ff7bc432b68], val:[1] s3 addr:[0x7ff7bc432b40], val:[3] s4 addr:[0x7ff7bc432b30], val:[4] destructor() [0x7ff7bc432b30] destructor() [0x7ff7bc432b40] destructor() [0x7ff7bc432b68]
In process function constructor(1) [0x7ff7b833eb20] move constructor, from [0x7ff7b833eb20] to [0x7ff7b833eb60] destructor() [0x7ff7b833eb20] move constructor, from [0x7ff7b833eb60] to [0x7ff7b833eb58] ---vals:--- _tmp addr:[0x7ff7b833eb60], val:[1] s addr:[0x7ff7b833eb58], val:[1] destructor() [0x7ff7b833eb58] destructor() [0x7ff7b833eb60]
对比问题1的输出,可以看到这个_tmp就是匿名的临时变量。
1 2 3 4 5 6 7 8 9 10
In process function constructor(1) [0x7ff7b218bb20] move constructor, from [0x7ff7b218bb20] to [0x7ff7b218bb60] destructor() [0x7ff7b218bb20] move constructor, from [0x7ff7b218bb60] to [0x7ff7b218bb68] destructor() [0x7ff7b218bb60] ---vals:--- s addr:[0x7ff7b218bb68], val:[1] destructor() [0x7ff7b218bb68]
In func1 function constructor(1) [0x7ff7b7970b10] move constructor, from [0x7ff7b7970b10] to [0x7ff7b7970b60] destructor() [0x7ff7b7970b10] move constructor, from [0x7ff7b7970b60] to [0x7ff7b7970b68] destructor() [0x7ff7b7970b60] In func2 function constructor(2) [0x7ff7b7970b10] move constructor, from [0x7ff7b7970b10] to [0x7ff7b7970b48] destructor() [0x7ff7b7970b10] move constructor, from [0x7ff7b7970b48] to [0x7ff7b7970b50] destructor() [0x7ff7b7970b48] In func3 function constructor(3) [0x7ff7b7970b18] destructor() [0x7ff7b7970b18] move constructor, from [0x7ff7b7970b18] to [0x7ff7b7970b40] ---vals:--- s1 addr:[0x7ff7b7970b68], val:[1] s2 addr:[0x7ff7b7970b50], val:[2] s3 addr:[0x7ff7b7970b40], val:[-1214837952] destructor() [0x7ff7b7970b40] destructor() [0x7ff7b7970b50] destructor() [0x7ff7b7970b68]