[#bsl-allocator-0a-2constructor-0c]
= xref:bsl.adoc[bsl]::xref:bsl/allocator-0a.adoc[allocator&lt;void&gt;]::allocator
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an allocator that uses the default allocator mechanism&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/allocator-0a/2constructor-04.adoc[allocator]();
----

[.small]#xref:bsl/allocator-0a/2constructor-04.adoc[_» more&period;&period;&period;_]#

Create an allocator that copies `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:bsl/allocator-0a/2constructor-017.adoc[allocator](xref:bsl/allocator-0a.adoc[allocator&lt;void&gt;] const& original) noexcept = default;
----

[.small]#xref:bsl/allocator-0a/2constructor-017.adoc[_» more&period;&period;&period;_]#

Convert a `bslma&colon;&colon;Allocator` pointer to an `allocator` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/allocator-0a/2constructor-0157.adoc[allocator](xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* mechanism);
----

[.small]#xref:bsl/allocator-0a/2constructor-0157.adoc[_» more&period;&period;&period;_]#

Create an allocator sharing the mechanism of the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ANY&lowbar;TYPE&gt;
xref:bsl/allocator-0a/2constructor-0154.adoc[allocator](xref:bsl/allocator-0df.adoc[allocator&lt;ANY&lowbar;TYPE&gt;] const& original) noexcept;
----

[.small]#xref:bsl/allocator-0a/2constructor-0154.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| allocator whose mechanism is shared
| *mechanism*
| allocator mechanism to use&semi; if 0, use the default
|===


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