C++Now 2018: Jon Kalb “Copy Elision”
Why Stack Overflow recommends it
Stack Overflow users link it in comments when explaining copy elision, RVO and why objects are or are not copied across function boundaries.
Recommended by 3 people across 3 different months, 2018 to 2021.
What it is
A roughly five minute lightning talk from C++Now 2018 in which Jon Kalb explains copy elision and return value optimization in C++. It is a short conference presentation from the CppNow channel.
What people said
Recommends Nir · 2018-06 · Stack Overflow · on “Copy elision when creating object inside emplace()”
I just want to add There is a great 5 minutes lightning talk about copy elision and RVO from Jon Kalb [this video] Also, you might get different results using different compilers gcc, clang or icc See **compiler explorer**, try different compilers and settings and see for yourself [LINK]
Recommends mgonnav · 2020-08 · Stack Overflow · on “how Objects in C++ stored? in heap or stack?”
In this case no, it doesn't. As user4581301 said, move constructors are disabled when copy constructors are declared. In this case, we might be seen copy elision [LINK] . I think this video [this video] illustratres this process very well.
Recommends zkoza · 2021-03 · Stack Overflow · on “C++ Why does returning rvalue reference change caller's behavior when function signature does not return rvalue reference?”
And if you want to understand why it does not matter wheher caller and callee are in the same or different compilation units, watch this: C++Now 2018: Jon Kalb “Copy Elision” [this video]