On this website there is an example of simple class with a move constructor.
How would a move constructor of a similar class look:
class MemoryPage
{
std::vector<char> buff;
public:
explicit MemoryPage(int sz=512)
{
for(size_t i=0;i<sz;i++)
buff.push_back(i);
}
};
would it be:
MemoryPage::MemoryPage(MemoryPage &&other)
{
this->buff = std::move(other.buff);
}
?