[#bsl-allocator-0ac]
= xref:bsl.adoc[bsl]::xref:bsl/allocator-0df.adoc[allocator]&lt;void&gt;
:relfileprefix: ../
:mrdocs:

Specialization of `allocator&lt;T&gt;` where `T` is `void`&period; Does not contain members that are unrepresentable for `void`&period; Note that this specialization may be removed in the future&period; Use `allocator&lt;&gt;` or `allocator&lt;char&gt;` instead&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:bsl/allocator-0df.adoc[allocator]&lt;void&gt;
    : public xref:bsl/allocator-0df.adoc[allocator&lt;BloombergLP::bslma::BslAllocator&lowbar;Voidish&gt;]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/allocator-0df.adoc[allocator&lt;BloombergLP::bslma::BslAllocator&lowbar;Voidish&gt;]`
| An STL&hyphen;compatible allocator that forwards allocation calls to an underlying mechanism object of a type derived from `bslma&colon;&colon;Allocator`&period; This class template adheres to the allocator requirements defined in section &lsqb;allocator&period;requirements&rsqb;and implements a superset of the `std&colon;&colon;pmr&colon;&colon;polymorphic&lowbar;allocator` class template described in section &lsqb;mem&period;poly&period;allocator&period;class&rsqb;of the C&plus;&plus; standard and may be used to instantiate any &lsqb;container&rsqb;class template that follows the STL allocator protocol&period; The allocation mechanism is chosen at run&hyphen;time, giving the programmer run&hyphen;time control over how a container allocates and frees memory&period;
|===

== Types

[cols="1,4"]
|===
| Name| Description
| xref:bsl/allocator-0ac/rebind.adoc[`rebind`] 
| This nested `struct` template, parameterized by `ANY&lowbar;TYPE`, provides a namespace for an `other` type alias, which is this template instantiated with `ANY&lowbar;TYPE` instead of `TYPE`&period; Note that this allocator type is convertible to and from `other` for any type, including `void`&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/allocator-0ac/const_pointer.adoc[`const&lowbar;pointer`] 
| 
| xref:bsl/allocator-0ac/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias to a constant `value&lowbar;type` reference&period;
| xref:bsl/allocator-0ac/const_void_pointer.adoc[`const&lowbar;void&lowbar;pointer`] 
| 
| xref:bsl/allocator-0ac/difference_type.adoc[`difference&lowbar;type`] 
| Difference type for allocations from this allocator&period;
| xref:bsl/allocator-0ac/pointer.adoc[`pointer`] 
| 
| xref:bsl/allocator-0ac/reference.adoc[`reference`] 
| This `typedef` is an alias to a modifiable `value&lowbar;type` reference&period;
| xref:bsl/allocator-0ac/size_type.adoc[`size&lowbar;type`] 
| Size type for allocations from this allocator&period;
| xref:bsl/allocator-0ac/value_type.adoc[`value&lowbar;type`] 
| 
| xref:bsl/allocator-0ac/void_pointer.adoc[`void&lowbar;pointer`] 
| 
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/allocator-0ac/2constructor-0c.adoc[`allocator`]         [.small]#[constructor]#
| Constructors
| xref:bsl/allocator-0ac/operator_assign.adoc[`operator&equals;`] 
| Modify this allocator to use the same mechanism as the specified `rhs` allocator and return a modifiable reference to this object&period; Note that `bsl&colon;&colon;allocator` objects should never be assigned at runtime, but, in the absence of `if constexpr`, such assignments can sometimes be found legitimately in dead branches (branches that are never taken at runtime) within function templates&semi; ideally, such code would be replaced by more sophisticated metaprogramming that avoided calls to this operator entirely&period; Invoking this assignment will result in a review error unless `rhs &equals;&equals; &ast;this`, i&period;e&period;, when the assignment would be a no&hyphen;op&period; In the future, the review error may be replaced with an a hard assertion failure&period;
| xref:bsl/allocator-0ac/address-071.adoc[`address`] 
| Return the address of the object referred to by the specified `x` reference, even if the (template parameter) `TYPE` overloads the unary `operator&amp;`&period;
| xref:bsl/allocator-0ac/allocate.adoc[`allocate`] 
| 
| xref:bsl/allocator-0ac/construct-09.adoc[`construct`] 
| `construct` overloads
| xref:bsl/allocator-0ac/deallocate.adoc[`deallocate`] 
| Deallocate a block of memory at the specified `p` address by returning it to the memory resource held by this allocator&period; Optionally specify the number of objects, `n`, to deallocate&period; The behavior is undefined unless `p` is the address of a block previously allocated by a call to `allocate` with the same `n` from a copy of this allocator having the same `value&lowbar;type` and not yet deallocated&period;
| xref:bsl/allocator-0ac/destroy.adoc[`destroy`] 
| Call the `TYPE` destructor for the object pointed to by the specified `address`&period; Do not directly deallocate any memory&period;
| xref:bsl/allocator-0ac/max_size.adoc[`max&lowbar;size`] 
| 
| xref:bsl/allocator-0ac/mechanism.adoc[`mechanism`] 
| Return a pointer to the mechanism object to which this proxy forwards allocation and deallocation calls&period;
| xref:bsl/allocator-0ac/select_on_container_copy_construction.adoc[`select&lowbar;on&lowbar;container&lowbar;copy&lowbar;construction`] 
| Return a default&hyphen;constructed allocator&period;
| xref:bsl/allocator-0ac/2conversion-0f.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;allocator&lt;BslAllocator&lowbar;Voidish&gt;, IsBitwiseEqualityComparable&gt;`] 
| 
| xref:bsl/allocator-0ac/2conversion-06.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;allocator&lt;void&gt;, IsBitwiseEqualityComparable&gt;`] 
| 
|===



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