[#BloombergLP-bsltf-StdAllocatorAdaptor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::StdAllocatorAdaptor
:relfileprefix: ../../
:mrdocs:

This class template provides the facade of an allocator but mostly delegates operations to the allocator object (of template parameter type) it adapts, except that it enables the propagation of the (stateful) allocator object to constructed elements, if appropriate&period;

== Synopsis

Declared in `&lt;bsltf&lowbar;stdallocatoradaptor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
class StdAllocatorAdaptor
    : public ALLOCATOR
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `ALLOCATOR`
| 
|===

== Types

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/rebind.adoc[`rebind`] 
| This nested `struct` template, parameterized by some `BDE&lowbar;OTHER&lowbar;TYPE`, provides a namespace for an `other` type alias, which is an allocator type following the same template as this one but that allocates elements of `BDE&lowbar;OTHER&lowbar;TYPE`&period; Note that this allocator type is convertible to and from `other` for any `BDE&lowbar;OTHER&lowbar;TYPE` including `void`&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/const_pointer.adoc[`const&lowbar;pointer`] 
| Alias for `ALLOCATOR&colon;&colon;const&lowbar;pointer`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/const_reference.adoc[`const&lowbar;reference`] 
| Alias for `ALLOCATOR&colon;&colon;const&lowbar;reference`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/difference_type.adoc[`difference&lowbar;type`] 
| Alias for `ALLOCATOR&colon;&colon;difference&lowbar;type`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/pointer.adoc[`pointer`] 
| Alias for `ALLOCATOR&colon;&colon;pointer`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/reference.adoc[`reference`] 
| Alias for `ALLOCATOR&colon;&colon;reference`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/size_type.adoc[`size&lowbar;type`] 
| Alias for `ALLOCATOR&colon;&colon;size&lowbar;type`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/value_type.adoc[`value&lowbar;type`] 
| Alias for `ALLOCATOR&colon;&colon;value&lowbar;type`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2constructor-088.adoc[`StdAllocatorAdaptor`]         [.small]#[constructor]#
| Create a standard allocator adaptor object for a default&hyphen;constructed allocator object of the (template parameter) type `ALLOCATOR`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2constructor-00.adoc[`StdAllocatorAdaptor`]         [.small]#[constructor]#
| Create a copy of the specified `original` allocator adaptor&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2constructor-089.adoc[`StdAllocatorAdaptor`]         [.small]#[constructor]#
| Create a copy of the specified `other` allocator adaptor&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2constructor-07.adoc[`StdAllocatorAdaptor`]         [.small]#[constructor]#
| Create a standard allocator adaptor object from the null pointer constant&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2constructor-06.adoc[`StdAllocatorAdaptor`]         [.small]#[constructor]#
| Create a standard allocator adaptor object for the specified `allocator` of the (template parameter) type `ALLOCATOR`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/allocator.adoc[`allocator`] 
| Return a reference to the non&hyphen;modifiable allocator instance associated with this standard allocator adaptor&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/construct.adoc[`construct`] 
| Construct an object of the (template parameter) `ELEMENT&lowbar;TYPE`, by forwarding the allocator instance associated with this allocator adaptor, if appropriate, and the specified (variable number of) `arguments` to the corresponding constructor of `ELEMENT&lowbar;TYPE`, at the specified uninitialized memory `address`&period; The behavior is undefined unless `address` is properly aligned for objects of `ELEMENT&lowbar;TYPE`&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/select_on_container_copy_construction.adoc[`select&lowbar;on&lowbar;container&lowbar;copy&lowbar;construction`] 
| Return an allocator adaptor for the allocator object returned by the `select&lowbar;on&lowbar;container&lowbar;copy&lowbar;construction` class method in the `allocator&lowbar;traits` class template for the allocator object, of the (template parameter) type `ALLOCATOR`, associated with this adaptor&period; The `allocator&lowbar;traits` class template presumably delegates this call to the allocator object if such an operation is supported by the `ALLOCATOR` type, or provides a suitable default behavior if such an operation is not supported&period;
| xref:BloombergLP/bsltf/StdAllocatorAdaptor/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;StdAllocatorAdaptor, IsStdAllocator&gt;`] 
| Declare `StdAllocatorAdaptor` as a standard allocator&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/operator_not_eq-092.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` adaptors are not equal and `false` otherwise&period; Two allocator adaptor instances are not equal if their associated allocator instances are not equal&period;
| xref:BloombergLP/bsltf/operator_eq-099.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` adaptors are equal and `false` otherwise&period; Two allocator adaptor instances are equal if their associated allocator instances are equal&period;
|===


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