This class provides a type‐agnostic container for managed pointer data members. This type exists so that a ManagedPtr_Ref (see bslma_managedptr) can point to the representation of a ManagedPtr even if the ManagedPtr_Ref object is instantiated on a different type than the managed pointer type (e.g., in the case of conversions or aliasing). ManagedPtr_Members also "erases" the type of each member, so that the same object code can be shared between all instantiations of the ManagedPtr class template, reducing template bloat. Note that objects of this type have an "unset" state, where the pointer member has a null value and the deleter member has an unspecified value.
Synopsis
Declared in <bslma_managedptr_members.h>
class ManagedPtr_Members;
Member Functions
Name |
Description |
|
Constructors |
Reset this object to an unset state with no effect on the previously managed object (if any). |
|
Return a reference providing non‐modifiable access to the deleter used to destroy the currently managed object (if any). The behavior is undefined unless |
|
Reset this object to have the same |
|
Destroy the currently managed object (if any), reset this object to have the same |
|
Return the address providing modifiable access to the currently managed object, or 0 if this object is in an unset state. Note that the returned pointer may be an alias to the managed object. |
|
Destroy the currently managed object (if any). Note that calling this method twice on an object that is not in an unset state, without assigning a new pointer to manage between the two calls, results in undefined behavior unless this object's deleter specifically supports such usage. |
|
Reset this object to have the specified |
|
Set |
|
Efficiently exchange the state of this object with the state of the specified |
Created with MrDocs