[#BloombergLP-bslma-ManagedPtr_Ref]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::ManagedPtr&lowbar;Ref
:relfileprefix: ../../
:mrdocs:

This class holds a managed pointer reference, returned by the implicit conversion operator in the class `ManagedPtr`&period; 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&hyphen;assignment operator for `ManagedPtr`&period; Note that while no members or methods of this class template depend on the specified `TARGET&lowbar;TYPE`, it is important to carry this type into conversions to support passing ownership of `ManagedPtr&lowbar;Members` pointers when assigning or constructing `ManagedPtr` objects&period;

== Synopsis

Declared in `&lt;bslma&lowbar;managedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
class ManagedPtr&lowbar;Ref;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/ManagedPtr_Ref/2constructor.adoc[`ManagedPtr&lowbar;Ref`]         [.small]#[constructor]#
| Create a `ManagedPtr&lowbar;Ref` object having the specified `base` value for its `base` attribute, and the specified `target` for its `target` attribute&period; Note that `target` (but not `base`) may be null&period;
| xref:BloombergLP/bslma/ManagedPtr_Ref/2destructor.adoc[`&#126;ManagedPtr&lowbar;Ref`] [.small]#[destructor]#
| Destroy this object&period; Note that the referenced managed object is _not_ destroyed&period;
| xref:BloombergLP/bslma/ManagedPtr_Ref/base.adoc[`base`] 
| Return a pointer to the managed state of a `ManagedPtr` object&period;
| xref:BloombergLP/bslma/ManagedPtr_Ref/target.adoc[`target`] 
| Return a pointer to the referenced object&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
