How is the move constructor implemented by the compiler?
Let's say I hae this class:
class Widget
{
public:
int a_;
int b_;
Widget(int a, int b):a_(a), b_(b){}
};
Is this how the move constructor is implemented by the compiler:
Widget(Widget&& other)
{
a_ = std::move(other.a);
b_ = std::move(other.b);
}
or is it like this:
Widget(Widget&& other)
{
a_ = other.a;
b_ = other.b;
}