[#BloombergLP-bslma-ManagedPtrDeleter] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::ManagedPtrDeleter :relfileprefix: ../../ :mrdocs: This complex constrained in‐core value‐semantic class holds the information necessary for `ManagedPtr` to correctly manage its underlying object, namely the addresses of `object` and `factory`, and the `deleter` function, optionally supplied through the constructors or through the `set` method. This information is stored in a sub‐structure to allow the compiler to copy it more efficiently. == Synopsis Declared in `<bslma_managedptrdeleter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ManagedPtrDeleter; ---- == Description See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes. This class: * supports a complete set of _value‐semantic_ operations * is _exception‐safe_ * is _alias‐safe_ * is `const` _thread‐safe_ For terminology see `bsldoc_glossary`. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/ManagedPtrDeleter/Deleter-03.adoc[`Deleter`] | Deleter function prototype used to destroy the managed pointer. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/ManagedPtrDeleter/2constructor-038.adoc[`ManagedPtrDeleter`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslma/ManagedPtrDeleter/clear.adoc[`clear`] | Reset this `ManagedPtrDeleter` to its default‐constructed state. | xref:BloombergLP/bslma/ManagedPtrDeleter/deleteManagedObject.adoc[`deleteManagedObject`] | Invoke the deleter object. The behavior is undefined unless `deleter` is not 0 and has not already been called on the managed object associated with this deleter. | xref:BloombergLP/bslma/ManagedPtrDeleter/deleter-0d.adoc[`deleter`] | Return the deleter function associated with this deleter. | xref:BloombergLP/bslma/ManagedPtrDeleter/factory.adoc[`factory`] | Return a pointer to the factory instance associated with this deleter. | xref:BloombergLP/bslma/ManagedPtrDeleter/object.adoc[`object`] | Return a pointer to the managed object associated with this deleter. | xref:BloombergLP/bslma/ManagedPtrDeleter/set.adoc[`set`] | Set this `ManagedPtrDeleter` to refer to the object and factory instances located at the specified `object` and `factory` memory locations, and the specified `deleter`. The behavior is undefined unless `deleter` is either 0, or points to a function whose behavior is defined if called once with `object` and `factory` as arguments. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/operator_not_eq-05.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise. Two `ManagedPtrDeleter` objects do not have the same value if any of the corresponding values of their `object`, `factory`, and `deleter` attributes are not the same. | xref:BloombergLP/bslma/operator_eq-02.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise. Two `ManagedPtrDeleter` objects have the same value if the corresponding values of their `object`, `factory`, and `deleter` attributes are the same. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#