A simple question but I can not find the set of rules that proves that the behavior of the following code example is correct. It seems here that only strDerived is moved from b, but strBase is copied? Will the implicitly declared move assignment operator of Derived (=> rule of zero) always call the implicitly declared copy assignment operator of Base when it is not finding any move assignment operator there? Is that guaranteed? (Does the same apply when doing move-construction instead of move-assignment in the example?)
#include <string>
struct Base
{
~Base() = default;
std::string strBase{ "Base"};
};
struct Derived : public Base
{
std::string strDerived{ "Derived" };
};
int main()
{
Derived a, b;
a = std::move( b );
return 0;
}