Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class Person {
  2. // …
  3.  
  4. // move constructor
  5.   Person(Person&& other) : name(std::move(other.name)), age(std::move(other.age)) {}
  6.  
  7. // move assignment operator
  8.   Person& operator=(Person&& other) {
  9.   name = std::move(other.name);
  10.   age = std::move(other.age);
  11.   return *this;
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement