mpqc::enable_shared_from_this< T > Class Template Reference
Collaboration diagram for mpqc::enable_shared_from_this< T >:

Documentation

template<typename T>
class mpqc::enable_shared_from_this< T >

just like std::enable_shared_from_this but can appear multiple times in the subhierarchy of a class

Note
see https://stackoverflow.com/a/12793989/587407
Template Parameters
Tclass to be derived from this

Public Member Functions

virtual ~enable_shared_from_this ()=default
 
std::shared_ptr< T > shared_from_this ()
 returns the pointer to this object More...
 
std::shared_ptr< std::add_const_t< T > > shared_from_this () const
 returns the pointer to this object More...
 
- Public Member Functions inherited from mpqc::detail::virt_base_of_enable_shared_from_this
virtual ~virt_base_of_enable_shared_from_this ()=default
 
bool shared_from_this_possible () const
 
template<typename Target , typename = std::enable_if_t<!std::is_const_v<Target>>>
std::shared_ptr< Target > cast_shared_from_this_to ()
 returns the pointer to this cast to a particular type More...
 
template<typename Target >
std::shared_ptr< std::add_const_t< Target > > cast_shared_from_this_to () const
 returns the pointer to this cast to a particular type More...
 

Constructor & Destructor Documentation

◆ ~enable_shared_from_this()

template<typename T >
virtual mpqc::enable_shared_from_this< T >::~enable_shared_from_this ( )
virtualdefault

Member Function Documentation

◆ shared_from_this() [1/2]

template<typename T >
std::shared_ptr<T> mpqc::enable_shared_from_this< T >::shared_from_this ( )
inline

returns the pointer to this object

Returns
std::shared_ptr to this object, or null if no shared_ptr exists yet (e.g. if it's constructed on the stack)

◆ shared_from_this() [2/2]

template<typename T >
std::shared_ptr<std::add_const_t<T> > mpqc::enable_shared_from_this< T >::shared_from_this ( ) const
inline

returns the pointer to this object

Returns
std::shared_ptr to this object, or null if no shared_ptr exists yet (e.g. if it's constructed on the stack)

The documentation for this class was generated from the following file:
  • mpqc/util/external/c++/memory