3 ms·
> std::make_shared. At which point it's mostly automatic memory management. Ignoring the awkward issue of circular references, yes. But that's not always trivi
by PaulDavisThe1st 4y ago
> std::make_shared. At which point it's mostly automatic memory management.
Ignoring the awkward issue of circular references, yes. But that's not always trivial to ignore.
- kllrnohj 4y agoimo one should always strongly bias/default to unique_ptr, at which point you just can't have circular references. shared_ptr should be used sparingly, not just because of performance but also as a matter of architecture. You should generally have an organized understanding of ownership, which unique_ptr helps with (and would be the default mode of Rust)