shared_ptr.get

Searching…

en.cppreference.com

std::shared_ptr<T>::get - cppreference.com

Jun 19, 2023 · A shared_ptr may share ownership of an object while storing a pointer to another object. get () returns the stored pointer, not the managed pointer. This page was last modified on 19 June 2023, at 06:03.

stackoverflow.com

How to get the Object being pointed by a shared pointer?

Jan 24, 2016 · You have two options to retrieve a reference to the object pointed to by a shared_ptr. Suppose you have a shared_ptr variable named ptr. You can get the reference either by using *ptr or *ptr.get(). The...

www.geeksforgeeks.org

shared_ptr in C++ - GeeksforGeeks

Jul 23, 2025 · std::shared_ptr is one of the smart pointers introduced in C++11. Unlike a simple pointer, it has an associated control block that keeps track of the reference count for the managed object.

cplusplus.com

shared_ptr - C++ Users

Get pointer Returns the stored pointer. The stored pointer points to the object the shared_ptr object dereferences to, which is generally the same as its owned pointer.

cppreference.net

std::shared_ptr - cppreference.net

May 6, 2025 · shared_ptr directly is the one returned by get () , while the pointer/object held by the control block is the one that will be deleted when the number of shared owners reaches zero.

www.apiref.com

std::shared_ptr<T>::get - C++ - API Reference Document

Returns the stored pointer. Parameters (none) Return value The stored pointer. Notes A shared_ptr may share ownership of an object while storing a pointer to another object. get() returns the stored pointer, not the m...