4 ms·
to whoever downvoted this, why would you write 'new MyObject()'?
by zabzonk 4y ago
to whoever downvoted this, why would you write 'new MyObject()'?
- andsoitis 4y agoI didn’t downvote and I don’t know C++, but I thought that the new and delete operators are how you manage dynamic memory allocation. Is it not the way?
- zabzonk 4y agono, it really isn't. mostly you don't need to manage objects dynamically at all (make them automatic) but if you do, use something like std::make_unique(...)