2 ms·
>instead of having clear memory ownership contracts You have a good point for shared_ptr, but unique_ptr offers the best clarity for ownership, much better tha
by hellofunk 10y ago
>instead of having clear memory ownership contracts
You have a good point for shared_ptr, but unique_ptr offers the best clarity for ownership, much better than raw pointers, since owning and non-owning pointers all look the same, but a unique_ptr that hands out regular pointers to its memory makes it clear in the code who owns what.