I'm confused of the rules of default function generation at this situation:
For the simplest class:
Class B{};
It will auto-generated the move constructor.
However, what if for
Class B{ public: ~B(){} }
I think it should be as same as the default deconstructor, will I have a default move constructor at this time? and how could I check it?
class A{
public:
A() {}
A(const A& lv) {cout << "a copy ctor." << endl;}
A(A&& rv) {cout << "a move ctor." << endl;}
};
class B{
public:
//~B(){}
private:
A a;
};
int main()
{
B b;
B b2(std::move(b));
return 0;
}
I tried this method, it seems the answer is no, but I'm not sure.