src: apply clang-tidy rule modernize-make-unique
Apply clang-tidy rule https://clang.llvm.org/extra/clang-tidy/checks/modernize-make-unique.html
And also in Item 21: Prefer std::make_unique and std::make_shared to direct use of new.
- Compared to direct use of new, make functions eliminate source code duplication, improve exception safety, and, for std::make_shared and std::allocate_shared, generate code that’s smaller and faster.
- Situations where use of make functions is inappropriate include the need to specify custom deleters and a desire to pass braced initializers.
cc @addaleax @refack @bnoordhuis
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines