Why there is default move constructor or assignment operator not created for derived classes? To demonstrate what I mean; having this setup code:
#include <utility>
struct A
{
A () { }
A (A&&) { throw 0; }
A& operator= (A&&) { throw 0; }
};
struct B : A
{ };
either of the following lines throws:
A x (std::move (A ());
A x; x = A ();
but neither of the following does:
B x (std::move (B ());
B x; x = B ();
In case it matters, I tested with GCC 4.4.
EDIT: Later test with GCC 4.5 showed the same behavior.
Reading through 12.8 in the 0x FCD (12.8/17 in particular for the move ctor), this appears to be a GCC bug. I see the same thing happening in 4.5 as you do in 4.4.
I may be missing a corner case on deleted functions, or something similar, but I don’t see any indication of that yet.