Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
std::unique_ptr
internally in Utility
The call to `std::make_unique<Type>` is perhaps a little weird since we immediately `release` the value right after. The main reason for using `std::make_unique` here is to avoid a naked `new`. The use of the `unique_ptr` here is a bit inconvenient, since we need to return the value of that type, but any transfer of ownership will clear out the original `unique_ptr`, and the target of the transfer is for a possibly different base type `T`, which can't be returned directly as type `Type`. We either need a `static_cast`, or do a bit of pointer shuffling using `release`.
- Loading branch information