.TH "std::shared_ptr< _Tp >" 3cxx "Sun Feb 7 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::shared_ptr< _Tp > \- A smart pointer with reference-counted copy semantics\&. .SH SYNOPSIS .br .PP .PP Inherits std::__shared_ptr< _Tp, _Lp >\&. .SS "Public Types" .in +1c .ti -1c .RI "using \fBelement_type\fP = typename __shared_ptr< _Tp >::element_type" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "constexpr \fBshared_ptr\fP () noexcept" .br .RI "Construct an empty shared_ptr\&. " .ti -1c .RI "template> \fBshared_ptr\fP (_Yp *__p)" .br .RI "Construct a shared_ptr that owns the pointer \fI__p\fP\&. " .ti -1c .RI "template> \fBshared_ptr\fP (_Yp *__p, _Deleter __d)" .br .RI "Construct a shared_ptr that owns the pointer \fI__p\fP and the deleter \fI__d\fP\&. " .ti -1c .RI "template> \fBshared_ptr\fP (_Yp *__p, _Deleter __d, _Alloc __a)" .br .RI "Construct a shared_ptr that owns the pointer \fI__p\fP and the deleter \fI__d\fP\&. " .ti -1c .RI "\fBshared_ptr\fP (const \fBshared_ptr\fP &) noexcept=default" .br .ti -1c .RI "template&>> \fBshared_ptr\fP (const \fBshared_ptr\fP< _Yp > &__r) noexcept" .br .RI "If \fI__r\fP is empty, constructs an empty shared_ptr; otherwise construct a shared_ptr that shares ownership with \fI__r\fP\&. " .ti -1c .RI "template \fBshared_ptr\fP (const \fBshared_ptr\fP< _Yp > &__r, element_type *__p) noexcept" .br .RI "Constructs a shared_ptr instance that stores \fI__p\fP and shares ownership with \fI__r\fP\&. " .ti -1c .RI "template&>> \fBshared_ptr\fP (const \fBweak_ptr\fP< _Yp > &__r)" .br .RI "Constructs a shared_ptr that shares ownership with \fI__r\fP and stores a copy of the pointer stored in \fI__r\fP\&. " .ti -1c .RI "template \fBshared_ptr\fP (nullptr_t __p, _Deleter __d)" .br .RI "Construct a shared_ptr that owns a null pointer and the deleter \fI__d\fP\&. " .ti -1c .RI "template \fBshared_ptr\fP (nullptr_t __p, _Deleter __d, _Alloc __a)" .br .RI "Construct a shared_ptr that owns a null pointer and the deleter \fI__d\fP\&. " .ti -1c .RI "constexpr \fBshared_ptr\fP (nullptr_t) noexcept" .br .RI "Construct an empty shared_ptr\&. " .ti -1c .RI "\fBshared_ptr\fP (\fBshared_ptr\fP &&__r) noexcept" .br .RI "Move-constructs a shared_ptr instance from \fI__r\fP\&. " .ti -1c .RI "template>> \fBshared_ptr\fP (\fBshared_ptr\fP< _Yp > &&__r) noexcept" .br .RI "Move-constructs a shared_ptr instance from \fI__r\fP\&. " .ti -1c .RI "template \fBshared_ptr\fP (\fBstd::auto_ptr\fP< _Tp1 > &&__r)" .br .ti -1c .RI "template>> \fBshared_ptr\fP (\fBunique_ptr\fP< _Yp, _Del > &&__r)" .br .ti -1c .RI "element_type * \fBget\fP () const noexcept" .br .ti -1c .RI "\fBoperator bool\fP () const" .br .ti -1c .RI "element_type & \fBoperator*\fP () const noexcept" .br .ti -1c .RI "element_type * \fBoperator\->\fP () const noexcept" .br .ti -1c .RI "\fBshared_ptr\fP & \fBoperator=\fP (const \fBshared_ptr\fP &) noexcept=default" .br .ti -1c .RI "template _Assignable< const \fBshared_ptr\fP< _Yp > & > \fBoperator=\fP (const \fBshared_ptr\fP< _Yp > &__r) noexcept" .br .ti -1c .RI "\fBshared_ptr\fP & \fBoperator=\fP (\fBshared_ptr\fP &&__r) noexcept" .br .ti -1c .RI "template _Assignable< \fBshared_ptr\fP< _Yp > > \fBoperator=\fP (\fBshared_ptr\fP< _Yp > &&__r) noexcept" .br .ti -1c .RI "template _Assignable< \fBunique_ptr\fP< _Yp, _Del > > \fBoperator=\fP (\fBunique_ptr\fP< _Yp, _Del > &&__r)" .br .ti -1c .RI "template bool \fBowner_before\fP (__shared_ptr< _Tp1, _Lp > const &__rhs) const noexcept" .br .ti -1c .RI "template bool \fBowner_before\fP (__weak_ptr< _Tp1, _Lp > const &__rhs) const noexcept" .br .ti -1c .RI "void \fBreset\fP () noexcept" .br .ti -1c .RI "template _SafeConv< _Yp > \fBreset\fP (_Yp *__p)" .br .ti -1c .RI "template _SafeConv< _Yp > \fBreset\fP (_Yp *__p, _Deleter __d)" .br .ti -1c .RI "template _SafeConv< _Yp > \fBreset\fP (_Yp *__p, _Deleter __d, _Alloc __a)" .br .ti -1c .RI "void \fBswap\fP (__shared_ptr< _Tp, _Lp > &__other) noexcept" .br .ti -1c .RI "bool \fBunique\fP () const noexcept" .br .ti -1c .RI "long \fBuse_count\fP () const noexcept" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template \fBshared_ptr\fP< _Yp > \fBallocate_shared\fP (const _Alloc &__a, _Args &&\&.\&.\&. __args)" .br .RI "Create an object that is owned by a shared_ptr\&. " .ti -1c .RI "class \fBweak_ptr< _Tp >\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class std::shared_ptr< _Tp >" A smart pointer with reference-counted copy semantics\&. The object pointed to is deleted when the last shared_ptr pointing to it is destroyed or reset\&. .PP Definition at line 103 of file bits/shared_ptr\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.