Question: 8. (Smart Pointers Review) We include some easy exercises on the use of smart pointers. Answer the following questions: a) Use move semantics to create
8. (Smart Pointers Review)
We include some easy exercises on the use of smart pointers.
Answer the following questions:
a) Use move semantics to create a shared pointer from another shared pointer and from a unique pointer.
b) Swap two shared pointers; swap two unique pointers.
c) Create a weak pointer from a shared pointer and from another weak pointer.
In all cases, determine what the reference count is and how resource ownership is addressed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
