On this website
there is an example of simple class with a move constructor. How would look like a move constructor of similar class:
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);
}
?
Aucun commentaire:
Enregistrer un commentaire