4 ms·
std::unique_ptr is of course the opposite of shared ownership, in that it requires you to explicitly transfer ownership if you need to do that. It's a beautiful
by TillE 4y ago
std::unique_ptr is of course the opposite of shared ownership, in that it requires you to explicitly transfer ownership if you need to do that. It's a beautiful feature which improves code clarity and reduces bugs.
- spacechild1 4y agoYes! Also, it significantly reduces the need for user defined destructors and move constructors/assignment operators.