src: Modernized unique_ptr construction
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows [commit guidelines]
A simple first contribution.
std::unique_ptr's constructor can lead to memory leaks if the constructed value, allocated through new
, throws an exception or something that causes an immediate backtrace on the callstack.
std::make_unique prevents this by allocating the memory for you, making it safer. Not only does it make it safer, it also makes it more readable.
I'm not sure whether I followed every guideline with this, but I hope I did.