[#BloombergLP-bslma-StdTestAllocator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::StdTestAllocator :relfileprefix: ../../ :mrdocs: An STL‐compatible test allocator that forwards to a `bslma::TestAllocator`. == Synopsis Declared in `<bslma_stdtestallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class StdTestAllocator; ---- == Description This class template forwards allocation calls to an underlying mechanism object of a type derived from `bslma::TestAllocator`. It adheres to the allocator requirements defined in section 20.1.5 [lib.allocator.requirements]of the C++ standard and may be used to instantiate any [container]class template that follows the STL allocator protocol. The allocation mechanism is chosen at run‐time, giving the programmer run‐time control over how a container allocates and frees memory. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/StdTestAllocator/rebind.adoc[`rebind`] | Rebind this allocator to another type. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/StdTestAllocator/const_pointer.adoc[`const_pointer`] | Alias for a pointer to constant value type. | xref:BloombergLP/bslma/StdTestAllocator/const_reference.adoc[`const_reference`] | Alias for a constant reference to the value type. | xref:BloombergLP/bslma/StdTestAllocator/difference_type.adoc[`difference_type`] | Alias for the allocator difference type. | xref:BloombergLP/bslma/StdTestAllocator/pointer.adoc[`pointer`] | Alias for a pointer to the value type. | xref:BloombergLP/bslma/StdTestAllocator/reference.adoc[`reference`] | Alias for a modifiable reference to the value type. | xref:BloombergLP/bslma/StdTestAllocator/size_type.adoc[`size_type`] | Alias for the allocator size type. | xref:BloombergLP/bslma/StdTestAllocator/value_type.adoc[`value_type`] | Alias for the value type. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/StdTestAllocator/2constructor-00.adoc[`StdTestAllocator`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslma/StdTestAllocator/address-02.adoc[`address`] | Return the address of the object referred to by the specified `x`. | xref:BloombergLP/bslma/StdTestAllocator/allocate.adoc[`allocate`] | Allocate space for the specified `n` objects of type `TYPE`. | xref:BloombergLP/bslma/StdTestAllocator/construct.adoc[`construct`] | Copy‐construct an object of type `TYPE` at the specified `address`. | xref:BloombergLP/bslma/StdTestAllocator/deallocate.adoc[`deallocate`] | Return memory previously allocated with `allocate`. | xref:BloombergLP/bslma/StdTestAllocator/destroy.adoc[`destroy`] | Destroy the object at the specified `address`. | xref:BloombergLP/bslma/StdTestAllocator/max_size.adoc[`max_size`] | Return the maximum number of `TYPE` elements this allocator can allocate. | xref:BloombergLP/bslma/StdTestAllocator/mechanism.adoc[`mechanism`] | Return a pointer to the mechanism object to which this proxy forwards allocation and deallocation calls. | xref:BloombergLP/bslma/StdTestAllocator/2conversion-08.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StdTestAllocator, IsBitwiseCopyable>`] | Declare `StdTestAllocator` as bitwise copyable. | xref:BloombergLP/bslma/StdTestAllocator/2conversion-01.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StdTestAllocator, IsBitwiseEqualityComparable>`] | Declare `StdTestAllocator` as bitwise equality comparable. | xref:BloombergLP/bslma/StdTestAllocator/2conversion-03.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StdTestAllocator, IsBitwiseMoveable>`] | Declare `StdTestAllocator` as bitwise moveable. | xref:BloombergLP/bslma/StdTestAllocator/2conversion-04.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StdTestAllocator, IsStdAllocator>`] | Declare `StdTestAllocator` as an STL‐compatible allocator. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/operator_not_eq-0e.adoc[`operator!=`] | Return `true` unless `lhs` and `rhs` share the same mechanism. | xref:BloombergLP/bslma/operator_not_eq-0f.adoc[`operator!=`] | Return `true` unless the specified `lhs` is a proxy for `rhs`. | xref:BloombergLP/bslma/operator_eq-07.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` are proxies for the same `bslma::TestAllocator` object. | xref:BloombergLP/bslma/operator_eq-0e.adoc[`operator==`] | Return `true` if the specified `lhs` is a proxy for the specified `rhs`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#