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.

C++11: write move constructor with atomic<bool> member?

I've got a class with an atomic member variable: struct Foo { std::atomic<bool> bar; /* ... lots of other …

c++ c++11 atomic move-semantics libstdc++
How does Rust provide move semantics?

The Rust language website claims move semantics as one of the features of the language. But I can't see how …

rust move-semantics
Why is `std::move` named `std::move`?

The C++11 std::move(x) function doesn't really move anything at all. It is just a cast to r-value. Why …

c++ c++11 move-semantics rvalue-reference c++-faq
When to make a type non-movable in C++11?

I was surprised this didn't show up in my search results, I thought someone would've asked this before, given the …

c++ c++11 move-semantics c++-faq
Correct use of `= delete` for methods in classes

Is the following snipplet correct for un-defining all otherwise generated methods and constructors for a class? struct Picture { // 'explicit': no …

c++ c++11 operator-overloading move-semantics rvalue-reference
C++11 move constructor

What would be the correct way to implement a move constructor considering the following class: class C { public: C(); C(…

c++ c++11 move-semantics
Implementing Move Constructor by Calling Move Assignment Operator

The MSDN article, How to: Write a Move Constuctor, has the following recommendation. If you provide both a move constructor …

c++ c++11 move-semantics move-constructor
Reusing a moved container?

What is the correct way to reuse a moved container? std::vector<int> container; container.push_back(1); auto …

c++ c++11 move-semantics
What are move semantics in Rust?

In Rust, there are two possibilities to take a reference Borrow, i.e., take a reference but don't allow mutating …

rust move-semantics ownership
Is std::move really needed on initialization list of constructor for heavy members passed by value?

Recently I read an example from cppreference.../vector/emplace_back: struct President { std::string name; std::string country; int year; …

c++ c++11 language-lawyer move-semantics initialization-list