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

== 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
  

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/grammar/recycled_ptr/2constructor-0ac.adoc[pass:[recycled_ptr]](
    xref:boost/urls/grammar/recycled.adoc[recycled]<T>& bin,
    std::nullptr_t) noexcept;
----

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/grammar/recycled_ptr/2constructor-056.adoc[pass:[recycled_ptr]]();
----

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/grammar/recycled_ptr/2constructor-05e.adoc[pass:[recycled_ptr]](std::nullptr_t) noexcept;
----

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/grammar/recycled_ptr/2constructor-0ab.adoc[pass:[recycled_ptr]](xref:boost/urls/grammar/recycled_ptr.adoc[recycled_ptr] const& other) noexcept;
----

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/grammar/recycled_ptr/2constructor-0f.adoc[pass:[recycled_ptr]](xref:boost/urls/grammar/recycled_ptr.adoc[recycled_ptr]&& other) noexcept;
----
  
=== 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.
[,cpp]
----
static recycled< std::string > bin;

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

// Put the string into a known state
ps->clear();
----
[,cpp]
----
&this->bin() == &bin && ! this->empty()
----




=== Parameters

|===
| Name | Description 

| *bin*
| 
The recycle bin to use

| *other*
| 
The pointer to copy

|===



=== See Also


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


