Using the R19 SDK I had no problem with following piece of code.
(omitted the CopyFrom implementation, needed for support in arrays)
class Test_base
{
MAXON_DISALLOW_COPY_AND_ASSIGN(Test_base);
public:
Test_base() {}
explicit Test_base(const Int32& value) : mValue(value) {}
virtual ~Test_base() {}
// provide move constructor and move assignment operator
Test_base(Test_base&& src) : mValue(std::move(src.mValue)) {}
MAXON_OPERATOR_MOVE_ASSIGNMENT(Test_base);
private:
Int32 mValue;
};
Migrating it to R20, however, I get:
error C2338: MAXON_OPERATOR_MOVE_ASSIGNMENT can't be used for classes with virtual functions.
Since this is a base class where derived classes will add their own members upon I need the destructor to be virtual. So, how do I go about resolving this issue?
If I don't provide the move assignment operator then, obviously, I get the following compiler issue for a Test_derived class derived from Test_base:
error C2248: 'Test_derived::operator =': cannot access private member declared in class 'Test_derived'