#include <iostream>
using namespace std;

class M{
	public: int database=0;
	M& operator=(M&& other){  //<--- change from "M&&" to "M&" will make it compilable
		this->database=other.database;
		other.database=0;
		return *this;
		
	}
	M(M &&other) {
		*this = std::move(other);
	}
	M (M& m)=default;
	M ()=default;
};
class B{
	public: M shouldMove;
};

int main() {
	B b;
	b.shouldMove.database=5;
	B b2=std::move(b);   //<--- error: use of deleted function 'B::B(B&&)'
	std::cout<<	b.shouldMove.database <<std::endl;
	std::cout<<	b2.shouldMove.database <<std::endl;
	return 0;
}