[#boost-urls-grammar-recycled_ptr]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::recycled&lowbar;ptr
:relfileprefix: ../../../
:mrdocs:

A pointer to a shared instance of T

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L148[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class recycled&lowbar;ptr;
----

== Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/grammar/recycled_ptr/2constructor-07.adoc[`recycled&lowbar;ptr`]         [.small]#[constructor]#
| Constructor
| xref:boost/urls/grammar/recycled_ptr/2destructor.adoc[`&#126;recycled&lowbar;ptr`] [.small]#[destructor]#
| Destructor
| xref:boost/urls/grammar/recycled_ptr/operator_assign-0b1.adoc[`operator&equals;`] 
| Assignment
| xref:boost/urls/grammar/recycled_ptr/acquire.adoc[`acquire`] 
| Return the referenced object
| xref:boost/urls/grammar/recycled_ptr/bin.adoc[`bin`] 
| Return the referenced recycle bin
| xref:boost/urls/grammar/recycled_ptr/empty.adoc[`empty`] 
| Return true if this does not reference an object
| xref:boost/urls/grammar/recycled_ptr/get.adoc[`get`] 
| Return the referenced object
| xref:boost/urls/grammar/recycled_ptr/operator_star.adoc[`operator&ast;`] 
| Return the referenced object
| xref:boost/urls/grammar/recycled_ptr/operator_ptr.adoc[`operator&hyphen;&gt;`] 
| Return the referenced object
| xref:boost/urls/grammar/recycled_ptr/release.adoc[`release`] 
| Release the referenced object
| xref:boost/urls/grammar/recycled_ptr/2conversion.adoc[`operator bool`] 
| Return true if this references an object
|===

== Friends

[cols=2]
|===
| Name
| Description
| `xref:boost/urls/grammar/recycled.adoc[boost::urls::grammar::recycled]`
| A thread&hyphen;safe collection of instances of T
|===

== Description

This is a smart pointer container which can acquire shared ownership of an instance of `T` upon or after construction&period; The instance is guaranteed to be in a valid, but unknown state&period; Every recycled pointer references a valid recycle bin&period;

== Example
[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin );

// Put the string into a known state
ps->clear();
----
== Template Parameters

[cols=2]
|===
| Name
| Description
| *T*
| the type of object to acquire, which must be _DefaultConstructible_&period;
|===


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