Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Indirection/SmartPointers/SharedOwnership

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Multiple std::shared_ptr<> variables can collectively manage a shared memory allocation, due to built-in reference-counting. C++ will automatically call delete on the underlying memory once all of the smart pointer variables have released their shared-ownership of it. Additional information about shared_ptr (includes interactive examples)