News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by jcelerier on Sunday September 22, 2019 @05:06AM (#21040385)
See the docs : https://en.cppreference.com/w/cpp/memory/unique_ptr/make_uni...

For C++ < 20 replace `std::make_unique<int>()` by `std::unique_ptr<int>(new int)` (which with all explicit uses of `new` can end up not being safe in some cases (in that case, only if you've not enough memory to allocate an int which should not really be a common occurence...)

For C++ >= 20 you get std::make_unique_default_init which does that properly.

There are no comments on this comment yet.