Top "Move-semantics" questions

Move semantics is a programming language feature that allows a copy operation to be replaced by a more efficient "move" when the source object is a temporary or an otherwise expiring object.

What is move semantics?

I just finished listening to the Software Engineering radio podcast interview with Scott Meyers regarding C++0x. Most of the …

c++ c++-faq c++11 move-semantics
push_back vs emplace_back

I'm a bit confused regarding the difference between push_back and emplace_back. void emplace_back(Type&& _Val); …

c++ visual-studio-2010 stl c++11 move-semantics
What is std::move(), and when should it be used?

What is it? What does it do? When should it be used? Good links are appreciated.

c++ c++11 move-semantics c++-faq stdmove
Passing std::string by Value or Reference

Possible Duplicate: Are the days of passing const std::string & as a parameter over? Should I pass std::string …

c++ string std move-semantics
How do I use a custom deleter with a std::unique_ptr member?

I have a class with a unique_ptr member. class Foo { private: std::unique_ptr<Bar> bar; ... }; The …

c++ c++11 move-semantics unique-ptr
C++11 rvalues and move semantics confusion (return statement)

I'm trying to understand rvalue references and move semantics of C++11. What is the difference between these examples, and which …

c++ c++11 move-semantics rvalue-reference c++-faq
Cannot move out of borrowed content / cannot move out of behind a shared reference

I don't understand the error cannot move out of borrowed content. I have received it many times and I have …

reference rust move-semantics borrow-checker
When should std::move be used on a function return value?

In this case struct Foo {}; Foo meh() { return std::move(Foo()); } I'm pretty sure that the move is unnecessary, because …

c++ c++11 move-semantics
Why would I std::move an std::shared_ptr?

I have been looking through the Clang source code and I found this snippet: void CompilerInstance::setInvocation( std::shared_ptr&…

c++ c++11 shared-ptr smart-pointers move-semantics
Move assignment operator and `if (this != &rhs)`

In the assignment operator of a class, you usually need to check if the object being assigned is the invoking …

c++ c++11 move-semantics move-assignment-operator