4 ms·
In C++ parlance ownership of pointers is dictated by how they are stored. Raw pointers are only views of the object passed around, these confer no ownership.
by daemin 12y ago
In C++ parlance ownership of pointers is dictated by how they are stored.
Raw pointers are only views of the object passed around, these confer no ownership.
std::unique_ptr owns a single unique instance of the memory.
std::shared_ptr (and std::weak_ptr) confer ownership of the memory amongst several other entities.