Use std::unique_ptr
(C++11) where possible.
Rationale:
- Avoid resource leaks (specifically: forgetting to
delete
an object created usingnew
) - Avoid undefined behaviour (specifically: double
delete
:s)
Note to reviewers: Please let me know if I’ve missed any obvious std::unique_ptr
candidates. Hopefully this PR should cover all the trivial cases.