mpqc::detail::virt_base_of_enable_shared_from_this Class Reference
Collaboration diagram for mpqc::detail::virt_base_of_enable_shared_from_this:

Documentation

Public Member Functions

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

◆ ~virt_base_of_enable_shared_from_this()

virtual mpqc::detail::virt_base_of_enable_shared_from_this::~virt_base_of_enable_shared_from_this ( )
virtualdefault

Member Function Documentation

◆ cast_shared_from_this_to() [1/2]

template<typename Target , typename = std::enable_if_t<!std::is_const_v<Target>>>
std::shared_ptr<Target> mpqc::detail::virt_base_of_enable_shared_from_this::cast_shared_from_this_to ( )
inline

returns the pointer to this cast to a particular type

Template Parameters
Targeta type derived from this type
Returns
std::shared_ptr to this object cast to type Target; will return null shared_from_this is not possible, or Target is not related to this object's type
See also
shared_from_this_possible()

◆ cast_shared_from_this_to() [2/2]

template<typename Target >
std::shared_ptr<std::add_const_t<Target> > mpqc::detail::virt_base_of_enable_shared_from_this::cast_shared_from_this_to ( ) const
inline

returns the pointer to this cast to a particular type

Template Parameters
Targeta type derived from this type
Returns
std::shared_ptr to this object cast to type Target; will return null shared_from_this is not possible, or Target is not related to this object's type
See also
shared_from_this_possible()

◆ shared_from_this_possible()

bool mpqc::detail::virt_base_of_enable_shared_from_this::shared_from_this_possible ( ) const
inline

checks if cast_shared_from_this_to() (or shared_from_this() in the derived class) will return nonzero

Returns
true if it's safe to obtain shared_ptr from this object

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