:relfileprefix: ../../../
[#boost-urls-grammar-recycled_ptr]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/grammar.adoc[pass:[grammar]]::recycled_ptr


A pointer to shared instance of T


== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L150[boost/url/grammar/recycled.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<class T>
class recycled_ptr;
----

==  Member Functions
[cols=2,separator=¦]
|===
¦Name ¦Description
¦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/2conversion.adoc[`operator bool`]  ¦

Return true if this references an object

¦xref:boost/urls/grammar/recycled_ptr/operator_star.adoc[`operator*`]  ¦

Return the referenced object

¦xref:boost/urls/grammar/recycled_ptr/operator_ptr.adoc[`operator->`]  ¦

Return the referenced object

¦xref:boost/urls/grammar/recycled_ptr/operator_assign.adoc[`operator=`]  ¦

Assignment

¦xref:boost/urls/grammar/recycled_ptr/2constructor.adoc[`recycled_ptr`] [.small]#[constructor]# ¦

Constructor

¦xref:boost/urls/grammar/recycled_ptr/release.adoc[`release`]  ¦

Release the referenced object

¦xref:boost/urls/grammar/recycled_ptr/2destructor.adoc[`~recycled_ptr`] [.small]#[destructor]# ¦

Destructor

|===

== Description


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

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

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

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



