Temporary reference enabling construction from temporary `ManagedPtr`s.

Synopsis

Declared in <bslma_managedptr.h>

template<class TARGET_TYPE>
class ManagedPtr_Ref;

Description

This class holds a managed pointer reference, returned by the implicit conversion operator in the class ManagedPtr. This class is used to allow the construction of managed pointers from temporary managed pointer objects, since temporaries cannot bind to the reference to a modifiable object used in the copy constructor and copy‐assignment operator for ManagedPtr. Note that while no members or methods of this class template depend on the specified TARGET_TYPE, it is important to carry this type into conversions to support passing ownership of ManagedPtr_Members pointers when assigning or constructing ManagedPtr objects.

Member Functions

Name

Description

ManagedPtr_Ref [constructor]

Create a managed‐pointer reference to target owned by base.

~ManagedPtr_Ref [destructor]

Destroy this object. Note that the referenced managed object is not destroyed.

base

Return a pointer to the managed state of a ManagedPtr object.

target

Return a pointer to the referenced object.

Created with MrDocs