rvalue refs und std :: move
Kann jemand erklären, warum B nicht kompiliert, aber C? Ich verstehe nicht, warum std :: move erforderlich ist, da die Variable bereits ein rvalue ref ist.
<code>struct A { int x; A(int x=0) : x(x) {} A(A&& a) : x(a.x) { a.x = 0; } }; struct B : public A { B() {} B(B&& b) : A(b) {} // compile error with g++-4.7 }; struct C : public A { C() {} C(C&& c) : A(std::move(c)) {} // ok, but why? }; </code>