Tag: RVO
4 posts
-
C++ RVO and NRVO: Copy Elision and Why return std::move(local) Backfires
RVO vs NRVO, C++17 guaranteed elision for prvalues, why std::move on return blocks NRVO, what benchmarks really show, and a practical checklist.
-
C++ Temporary Objects: Lifetime, const&, RVO, and Pitfalls
When C++ creates temporaries, why they die at the end of the full expression, what const& extension covers, and the c_str, string_view and lock_guard traps.
-
RVO vs NRVO: When C++ Compilers Elide Copies, and When std::move Makes It Worse
RVO vs NRVO: when the compiler elides copies on return, C++17 guaranteed elision for prvalues, NRVO heuristics, and interaction with move semantics.
-
C++ return Statements: Copy Elision, Dangling Returns and Signaling Failure
How C++ return behaves: guaranteed elision vs NRVO, when return copies instead of moves, -Wreturn-local-addr, -Wreturn-type, and std::optional results.