Top "Rvalue-reference" questions

An rvalue reference is a new language feature in C++11 representing a reference to an rvalue.

Lvalue to rvalue reference binding

The compiler keeps complaining I'm trying to bind an lvalue to an rvalue reference, but I cannot see how. I'm …

c++ c++11 move-semantics rvalue-reference
Is the pass-by-value-and-then-move construct a bad idiom?

Since we have move semantics in C++, nowadays it is usual to do void set_a(A a) { _a = std::…

c++ c++11 move-semantics pass-by-value rvalue-reference
Why user-defined move-constructor disables the implicit copy-constructor?

While I'm reading boost/shared_ptr.hpp, i saw this code: // generated copy constructor, destructor are fine... #if defined( BOOST_…

c++ boost c++11 copy-constructor rvalue-reference
Is there any case where a return of a RValue Reference (&&) is useful?

Is there a reason when a function should return a RValue Reference? A technique, or trick, or an idiom or …

c++ c++11 move-semantics rvalue-reference
Should I std::move a shared_ptr in a move constructor?

Consider: #include <cstdlib> #include <memory> #include <string> #include <vector> #include <algorithm&…

c++ c++11 shared-ptr rvalue-reference
Move Constructors and Static Arrays

I've been exploring the possibilities of Move Constructors in C++, and I was wondering what are some ways of taking …

c++ c++11 rvalue-reference move-semantics move-constructor
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
Do rvalue references to const have any use?

I guess not, but I would like to confirm. Is there any use for const Foo&&, where Foo …

c++ c++11 constants rvalue-reference
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
Passing rvalues through std::bind

I want to pass an rvalue through std::bind to a function that takes an rvalue reference in C++0x. …

c++ c++11 std rvalue-reference rvalue