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

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


Constructor


== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
explicit
recycled_ptr(xref:boost/urls/grammar/recycled.adoc[recycled]<T>& bin);
----

== Description


Upon construction, this acquires
exclusive access to an object of type
`T` which is either recycled from the
specified bin, or newly allocated.
The object is in an unknown but
valid state.

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

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

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

=== Postconditions
[,cpp]
----
&this->bin() == &bin && ! this->empty()
----





== Parameters

|===
| Name | Description 

| *bin*
| 
The recycle bin to use

|===




== See Also


xref:boost/urls/grammar/recycled.adoc[recycled]
.



