BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl::SharedPtr_ImpUtil Struct Reference

#include <bslstl_sharedptr.h>

Detailed Description

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 bslstl_sharedptr

Classes

struct  Extent
 
struct  Extent< TYPE[], 0 >
 
struct  Extent< TYPE[], DIM >
 
struct  Extent< TYPE[SIZE], 0 >
 
struct  Extent< TYPE[SIZE], DIM >
 

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 ()
 

Member Function Documentation

◆ loadEnableSharedFromThis() [1/2]

template<class SHARED_TYPE , class ENABLE_TYPE >
void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis ( const bsl::enable_shared_from_this< ENABLE_TYPE > *  result,
bsl::shared_ptr< SHARED_TYPE > *  sharedPtr 
)
inlinestatic

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
Note that overload resolution will select the overload below if a supplied type does not derive from a specialization of enable_shared_from_this .

◆ loadEnableSharedFromThis() [2/2]

void bslstl::SharedPtr_ImpUtil::loadEnableSharedFromThis ( const volatile void *  ,
const void *   
)
inlinestatic

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 .

◆ throwBadWeakPtr()

static void bslstl::SharedPtr_ImpUtil::throwBadWeakPtr ( )
static

Throw a bsl::bad_weak_ptr exception.


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