Quick Links: |
#include <bslstl_sharedptr.h>
Static Public Member Functions | |
template<class SHARED_TYPE , class ENABLE_TYPE > | |
static void | loadEnableSharedFromThis (const bsl::enable_shared_from_this< ENABLE_TYPE > *result, bsl::shared_ptr< SHARED_TYPE > *sharedPtr) |
static void | loadEnableSharedFromThis (const volatile void *, const void *) BSLS_KEYWORD_NOEXCEPT |
static void | throwBadWeakPtr () |
template<class TYPE > | |
static void * | voidify (TYPE *address) BSLS_KEYWORD_NOEXCEPT |
template<class TYPE > | |
static TYPE * | unqualify (const volatile TYPE *address) BSLS_KEYWORD_NOEXCEPT |
This struct
should be used by only shared_ptr
constructors. Its purpose is to enable shared_ptr
constructors to determine if the (template parameter) types COMPATIBLE_TYPE
or ELEMENT_TYPE
have a specialization of enable_shared_from_this
as an unambiguous, publicly accessible, base class.
See Component bslstl_sharedptr
static void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis | ( | const bsl::enable_shared_from_this< ENABLE_TYPE > * | result, | |
bsl::shared_ptr< SHARED_TYPE > * | sharedPtr | |||
) | [static] |
Load the specified result
with the control block (i.e., SharedPtrRep
) from the specified sharedPtr
if (and only if) result
is not 0 and result
does not already refer to a non-expired shared-pointer control block. If result
is 0, or if result->d_weakThis
has not expired, this operation has no effect. This operation is used to initialize data members from a type that inherits from enable_shared_from_this
when constructing an out-of-place shared pointer representation. This function shall be called only by shared_ptr
constructors creating shared pointers for classes that derive publicly and unambiguously from a specialization of enabled_shared_from_this
. Note that overload resolution will select the overload below if a supplied type does not derive from a specialization of enable_shared_from_this
.
static void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis | ( | const volatile void * | , | |
const void * | ||||
) | [static] |
Do nothing. This overload is selected, rather than the immediately preceding template, when the SHARED_TYPE
template type parameter of shared_ptr<SHARED_TYPE>
does not derive from a specialization of enable_shared_from_this
.
static void bslstl::SharedPtr_ImpUtil::throwBadWeakPtr | ( | ) | [static] |
Throw a bsl::bad_weak_ptr
exception.
static void* bslstl::SharedPtr_ImpUtil::voidify | ( | TYPE * | address | ) | [static] |
Return the specified address
cast as a pointer to void
, even if (the template parameter) TYPE
is cv-qualified.
static TYPE* bslstl::SharedPtr_ImpUtil::unqualify | ( | const volatile TYPE * | address | ) | [static] |
Return the specified address
of a potentially cv
-qualified object of the given (template parameter) TYPE
, cast as a pointer to a modifiable non-volatile object of the given TYPE
.