3 ms·
The idea is to use shared_ptr when your semantics are such there can be no clear owner. A good example of this is inside a class where you're implementing copy-
by nly 11y ago
The idea is to use shared_ptr when your semantics are such there can be no clear owner. A good example of this is inside a class where you're implementing copy-on-write. Imho, you should always endeavour to avoid using shared_ptr in public APIs. It works especially well where the target is const.
- masklinn 11y ago> Good examples of this is inside classes where you're implementing copy-on-write. Or functional "persistent" datastructures.