3 ms·
I would say modern C++ encourages unique_ptrs and naked pointers for ephemeral references much more than shared_ptr. C++11 invented it after all while shared_p
by slededit 8y ago
I would say modern C++ encourages unique_ptrs and naked pointers for ephemeral references much more than shared_ptr. C++11 invented it after all while shared_ptr has been around longer.
Some projects have gone as far as to say shared_ptr is code smell since you never declared who the actual owner is. The memory may not be free’d but that doesn’t mean it isn’t stale.