3 ms·
Swapping out unique_ptr/shared_ptr for some other smart pointer container doesn't negate what I said. New/delete are still basically deprecated territory. Qt i
by kllrnohj 4y ago
Swapping out unique_ptr/shared_ptr for some other smart pointer container doesn't negate what I said.
New/delete are still basically deprecated territory. Qt isn't any different here, other than it seems they are behind the curve with make() variants of their pointer containers. So you'd want to make your own of that, and then go back to the world of "new/delete are deprecated"
- BenFrantzDale 4y agoYou can always create your own “algorithms”. Our codebase has one that creates a new QObject that is a child of an existing one, returning a (raw) pointer to the new child object. That’s a case of not “no raw `new`”, but the next-best thing: isolating raw `new` to the one algorithm that does just that, and letting all other code depend on that.