Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- UniquePtr<int> a;
- int* t = new int;
- *t = 5;
- a.reset(t);
- UniquePtr<int> b(std::move(a));
- int *c = new int;
- *c = 1000;
- UniquePtr<int> z(std::move(c));
- std::cout << *z;
- z.swap(b);
- std::cout << *(z.release());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement