std::shared_ptr::get

From cppreference.com
< cpp‎ | memory‎ | shared ptr
 
 
 
Dynamic memory management
Uninitialized storage
(C++17)
(deprecated since c++17)
(deprecated since c++17)
(deprecated since c++17)
Garbage collection support
Miscellaneous
(C++11)
(C++11)
C Library
Low level memory management
 
 
T* get() const;
(until C++17)
element_type* get() const;
(since C++17)

Returns the stored pointer.

Parameters

(none)

Return value

The stored pointer.

Exceptions

noexcept specification:  
noexcept
  

Notes

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.