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

This allocator implements the minimal interface to comply with section 20&period;1&period;5 (&lsqb;lib&period;allocator&period;requirements&rsqb;) of the C&plus;&plus;03 standard&period; Instances of this allocator delegate their operations to a globally configured delegate allocator as C&plus;&plus;03 compliant allocators cannot have individually identifiable state (see `StdTestAllocatorConfiguration` and &apos;StdTestAllocatorConfigurationGuard)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class StdTestAllocator;
----

== Types

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdTestAllocator-05/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/StdTestAllocator-05/const_pointer.adoc[`const&lowbar;pointer`] 
| Alias for a pointer to `const TYPE`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/const_reference.adoc[`const&lowbar;reference`] 
| Alias for a reference to `const TYPE`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/difference_type.adoc[`difference&lowbar;type`] 
| Alias for `bsls&colon;&colon;Types&colon;&colon;IntPtr`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/pointer.adoc[`pointer`] 
| Alias for a pointer to `TYPE`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/reference.adoc[`reference`] 
| Alias for a reference to `TYPE`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/size_type.adoc[`size&lowbar;type`] 
| Alias for `bsls&colon;&colon;Types&colon;&colon;UintPtr`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/value_type.adoc[`value&lowbar;type`] 
| Alias for the allocated `TYPE`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdTestAllocator-05/2constructor-0b.adoc[`StdTestAllocator`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bsltf/StdTestAllocator-05/address-0a.adoc[`address`] 
| `address` overloads
| xref:BloombergLP/bsltf/StdTestAllocator-05/allocate.adoc[`allocate`] 
| Allocate enough (properly aligned) space for the specified `numElements` of type `T`&period; If the configured delegate allocator is unable to fulfill the allocation request, an exception (typically `bsl&colon;&colon;bad&lowbar;alloc`) will be thrown&period; The behavior is undefined unless `numElements &lt;&equals; max&lowbar;size()`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/construct.adoc[`construct`] 
| Create an object of (template parameter) `ELEMENT&lowbar;TYPE` at the specified `address`, constructed by forwarding the specified `argument1` and the (variable number of) additional specified `arguments` to the corresponding constructor of `ELEMENT&lowbar;TYPE`&period; The behavior is undefined unless `address` refers to a block of memory having sufficient size and alignment for an object of `ELEMENT&lowbar;TYPE`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/deallocate.adoc[`deallocate`] 
| Return memory previously at the specified `address` for `numElements` back to this allocator&period; The `numElements` argument is ignored by this allocator type&period; The behavior is undefined unless `address` was allocated using this allocator object and has not already been deallocated&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/destroy.adoc[`destroy`] 
| Call the `ELEMENT&lowbar;TYPE` destructor for the object at the specified `address` but do not deallocate the memory at `address`&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/max_size.adoc[`max&lowbar;size`] 
| Return the maximum number of elements of type `TYPE` that can be allocated using this allocator in a single call to the `allocate` method&period; Note that there is no guarantee that attempts at allocating less elements than the value returned by `max&lowbar;size` will not throw&period;
| xref:BloombergLP/bsltf/StdTestAllocator-05/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;StdTestAllocator, IsStdAllocator&gt;`] 
| Declare `StdTestAllocator` as a standard allocator&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/StdTestAllocator-0e.adoc[`StdTestAllocator&lt;void&gt;`] 
| This specialization of `StdTestAllocator` for `void` type as the parameterized `TYPE` does not contain members that are unrepresentable for `void`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/operator_not_eq-0e.adoc[`operator!&equals;`]
| Return `false` because `StdTestAllocator` does not hold a state&period;
| xref:BloombergLP/bsltf/operator_eq-0e5.adoc[`operator&equals;&equals;`]
| Return `true` because `StdTestAllocator` does not hold a state&period;
|===


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