Tag: move semantics
9 posts
-
C++14 Init Capture: Moving unique_ptr into Lambdas, Reference Init and Evaluation Time
C++14 init capture [x = expr]: auto-style deduction, when it runs, moving unique_ptr in, why std::function rejects it, [&r = x], [*this] and pack capture.
-
C++ Move Errors
Understand use-after-move, what std::move really does, move constructors, RVO, and ten common mistakes—so you can fix crashes and avoid undefined behavior.
-
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.
-
Shallow vs Deep Copy and Move Semantics: How to Answer the C++ Interview Question
Answer the C++ copy vs move interview question: shallow vs deep copy, Rule of Three and Five, rvalue references, what std::move does, perfect forwarding.
-
Lvalues, Rvalues, xvalues: C++ Value Categories and How They Drive Move Semantics
Learn C++ lvalues and rvalues: value categories, references, move semantics, and std::move—with examples for overload resolution and fewer unnecessary.
-
C++ Move Constructor: rvalue Stealing & noexcept Best
C++ move constructors: rvalue resource transfer, copy vs move, vector and noexcept, self-move, and when not to std::move return locals.
-
C++ Move Semantics: Copy vs Move Explained
C++11 move semantics: rvalue references, std::move, Rule of Five, noexcept move constructors—copy vs move performance and safe usage patterns.
-
C++ Copy & Move Constructors: Rule of Five and RAII
Rule of Five in C++: copy/move constructors and assignment, deep copy vs shallow, self-assignment, noexcept moves, copy elision, and FileHandle patterns.
-
C++ emplace vs push: Performance and Move Semantics
When emplace_back really beats push_back: in-place construction, how move semantics narrow the gap, and traps with explicit constructors and exceptions.