move constructor と move assignment operator のデフォルトの書き方
class Derived : public Base { std::vector<int> vec; std::string name; public: // move constructor Derived(Derived&& x) : Base(std::forward<Base>(x)), vec(std::move(x.vec)), name(std::move(x.name)) {} // move assignment operator Derived& operator=(Derived&& x) { Base::operator=(std::forward<Base>(x)); vec = std::move(x.vec); name = std::move(x.name); return *this; } };