MOS Source Code
Loading...
Searching...
No Matches
shared_ptr< T > Class Template Reference

#include <shared_ptr.hpp>

Public Types

using element_type = std::remove_extent_t<T>
 

Public Member Functions

constexpr shared_ptr () noexcept
 
constexpr shared_ptr (std::nullptr_t) noexcept
 
template<typename Y>
 shared_ptr (Y *ptr)
 
 shared_ptr (__shared_ptr_core< T > *cb)
 
 shared_ptr (const shared_ptr &r) noexcept
 
template<typename Y>
 shared_ptr (shared_ptr< Y > &other)
 
 shared_ptr (shared_ptr &&r) noexcept
 
template<typename Y>
 shared_ptr (shared_ptr< Y > &&other)
 
shared_ptroperator= (const shared_ptr &r) noexcept
 
template<class Y>
shared_ptroperator= (const shared_ptr< Y > &r) noexcept
 
shared_ptroperator= (shared_ptr &&r) noexcept
 
template<class Y>
shared_ptroperator= (shared_ptr< Y > &&r) noexcept
 
 ~shared_ptr ()
 
long use_count () const
 
void reset ()
 
T * release ()
 
element_typeget () const
 
element_typeoperator* () const
 
element_typeoperator-> () const
 
 operator bool () const
 

Private Attributes

__shared_ptr_core< T > * _c
 

Friends

class weak_ptr< T >
 
void swap (shared_ptr &lhs, shared_ptr &rhs)
 
bool operator== (const shared_ptr &lhs, const shared_ptr &rhs)
 
bool operator== (const shared_ptr &lhs, std::nullptr_t)
 

Detailed Description

template<typename T>
class mos::shared_ptr< T >

Definition at line 139 of file shared_ptr.hpp.

Member Typedef Documentation

◆ element_type

template<typename T>
using element_type = std::remove_extent_t<T>

Definition at line 144 of file shared_ptr.hpp.

Constructor & Destructor Documentation

◆ shared_ptr() [1/8]

template<typename T>
shared_ptr ( )
inlineconstexprnoexcept

◆ shared_ptr() [2/8]

template<typename T>
shared_ptr ( std::nullptr_t )
inlineconstexprnoexcept

Definition at line 148 of file shared_ptr.hpp.

◆ shared_ptr() [3/8]

template<typename T>
template<typename Y>
shared_ptr ( Y * ptr)
inlineexplicit

Definition at line 151 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ shared_ptr() [4/8]

template<typename T>
shared_ptr ( __shared_ptr_core< T > * cb)
inlineexplicit

Definition at line 153 of file shared_ptr.hpp.

◆ shared_ptr() [5/8]

template<typename T>
shared_ptr ( const shared_ptr< T > & r)
inlinenoexcept

Definition at line 159 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ shared_ptr() [6/8]

template<typename T>
template<typename Y>
shared_ptr ( shared_ptr< Y > & other)
inline

Definition at line 166 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ shared_ptr() [7/8]

template<typename T>
shared_ptr ( shared_ptr< T > && r)
inlinenoexcept

Definition at line 172 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ shared_ptr() [8/8]

template<typename T>
template<typename Y>
shared_ptr ( shared_ptr< Y > && other)
inline

Definition at line 178 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ ~shared_ptr()

template<typename T>
~shared_ptr ( )
inline

Definition at line 261 of file shared_ptr.hpp.

Member Function Documentation

◆ operator=() [1/4]

template<typename T>
shared_ptr & operator= ( const shared_ptr< T > & r)
inlinenoexcept

Definition at line 184 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ operator=() [2/4]

template<typename T>
template<class Y>
shared_ptr & operator= ( const shared_ptr< Y > & r)
inlinenoexcept

Definition at line 204 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ operator=() [3/4]

template<typename T>
shared_ptr & operator= ( shared_ptr< T > && r)
inlinenoexcept

Definition at line 223 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ operator=() [4/4]

template<typename T>
template<class Y>
shared_ptr & operator= ( shared_ptr< Y > && r)
inlinenoexcept

Definition at line 242 of file shared_ptr.hpp.

+ Here is the call graph for this function:

◆ use_count()

template<typename T>
long use_count ( ) const
inline

Definition at line 272 of file shared_ptr.hpp.

◆ reset()

template<typename T>
void reset ( )
inline

Definition at line 279 of file shared_ptr.hpp.

◆ release()

template<typename T>
T * release ( )
inline

Definition at line 289 of file shared_ptr.hpp.

◆ get()

template<typename T>
element_type * get ( ) const
inline

Definition at line 302 of file shared_ptr.hpp.

◆ operator*()

template<typename T>
element_type & operator* ( ) const
inline

Definition at line 309 of file shared_ptr.hpp.

◆ operator->()

template<typename T>
element_type * operator-> ( ) const
inline

Definition at line 314 of file shared_ptr.hpp.

◆ operator bool()

template<typename T>
operator bool ( ) const
inline

Definition at line 337 of file shared_ptr.hpp.

Friends And Related Symbol Documentation

◆ weak_ptr< T >

template<typename T>
friend class weak_ptr< T >
friend

Definition at line 135 of file shared_ptr.hpp.

◆ swap

template<typename T>
void swap ( shared_ptr< T > & lhs,
shared_ptr< T > & rhs )
friend

Definition at line 322 of file shared_ptr.hpp.

◆ operator== [1/2]

template<typename T>
bool operator== ( const shared_ptr< T > & lhs,
const shared_ptr< T > & rhs )
friend

Definition at line 327 of file shared_ptr.hpp.

◆ operator== [2/2]

template<typename T>
bool operator== ( const shared_ptr< T > & lhs,
std::nullptr_t  )
friend

Definition at line 332 of file shared_ptr.hpp.

Member Data Documentation

◆ _c


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