Named Return Value Optimization
Here we learn about how compilers use NRVO and Eliding to optimize.
We'll cover the following...
Compilers and NRVO
Compilers are even smarter, and they can elide in cases when you return a named object - it’s called Named Return Value Optimization - NRVO
Press + to interact
Test Create(){Test t;// several instruction to initialize 't'...return t;}auto n = Create(); // temporary will be usually elided
...