libstdc++
std::shared_ptr< _Tp > Class Template Reference

Inherits std::__shared_ptr< _Tp, _Lp >.

Public Types

using element_type = typename __shared_ptr< _Tp >::element_type
 

Public Member Functions

constexpr shared_ptr () noexcept
 
template<typename _Yp , typename = _Constructible<_Yp*>>
 shared_ptr (_Yp *__p)
 
template<typename _Yp , typename _Deleter , typename = _Constructible<_Yp*, _Deleter>>
 shared_ptr (_Yp *__p, _Deleter __d)
 
template<typename _Yp , typename _Deleter , typename _Alloc , typename = _Constructible<_Yp*, _Deleter, _Alloc>>
 shared_ptr (_Yp *__p, _Deleter __d, _Alloc __a)
 
 shared_ptr (const shared_ptr &) noexcept=default
 
template<typename _Yp , typename = _Constructible<const shared_ptr<_Yp>&>>
 shared_ptr (const shared_ptr< _Yp > &__r) noexcept
 
template<typename _Yp >
 shared_ptr (const shared_ptr< _Yp > &__r, element_type *__p) noexcept
 
template<typename _Yp , typename = _Constructible<const weak_ptr<_Yp>&>>
 shared_ptr (const weak_ptr< _Yp > &__r)
 
template<typename _Deleter >
 shared_ptr (nullptr_t __p, _Deleter __d)
 
template<typename _Deleter , typename _Alloc >
 shared_ptr (nullptr_t __p, _Deleter __d, _Alloc __a)
 
constexpr shared_ptr (nullptr_t) noexcept
 
 shared_ptr (shared_ptr &&__r) noexcept
 
template<typename _Yp , typename = _Constructible<shared_ptr<_Yp>>>
 shared_ptr (shared_ptr< _Yp > &&__r) noexcept
 
template<typename _Tp1 , typename >
 shared_ptr (std::auto_ptr< _Tp1 > &&__r)
 
template<typename _Yp , typename _Del , typename = _Constructible<unique_ptr<_Yp, _Del>>>
 shared_ptr (unique_ptr< _Yp, _Del > &&__r)
 
element_type * get () const noexcept
 
 operator bool () const
 
element_type & operator* () const noexcept
 
element_type * operator-> () const noexcept
 
shared_ptroperator= (const shared_ptr &) noexcept=default
 
template<typename _Yp >
_Assignable< const shared_ptr< _Yp > & > operator= (const shared_ptr< _Yp > &__r) noexcept
 
shared_ptroperator= (shared_ptr &&__r) noexcept
 
template<class _Yp >
_Assignable< shared_ptr< _Yp > > operator= (shared_ptr< _Yp > &&__r) noexcept
 
template<typename _Yp , typename _Del >
_Assignable< unique_ptr< _Yp, _Del > > operator= (unique_ptr< _Yp, _Del > &&__r)
 
template<typename _Tp1 >
bool owner_before (__shared_ptr< _Tp1, _Lp > const &__rhs) const noexcept
 
template<typename _Tp1 >
bool owner_before (__weak_ptr< _Tp1, _Lp > const &__rhs) const noexcept
 
void reset () noexcept
 
template<typename _Yp >
_SafeConv< _Yp > reset (_Yp *__p)
 
template<typename _Yp , typename _Deleter >
_SafeConv< _Yp > reset (_Yp *__p, _Deleter __d)
 
template<typename _Yp , typename _Deleter , typename _Alloc >
_SafeConv< _Yp > reset (_Yp *__p, _Deleter __d, _Alloc __a)
 
void swap (__shared_ptr< _Tp, _Lp > &__other) noexcept
 
bool unique () const noexcept
 
long use_count () const noexcept
 

Friends

template<typename _Yp , typename _Alloc , typename... _Args>
shared_ptr< _Yp > allocate_shared (const _Alloc &__a, _Args &&... __args)
 
class weak_ptr< _Tp >
 

Detailed Description

template<typename _Tp>
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.

Definition at line 103 of file bits/shared_ptr.h.


The documentation for this class was generated from the following files: