[#bsl-Deque_BlockCreator]
= xref:bsl.adoc[bsl]::Deque&lowbar;BlockCreator
:relfileprefix: ../
:mrdocs:

This class allocates blocks at the front or back of a deque and tentatively adds them to the deque&period; It also keeps track of how many of the newly allocated blocks have actually been used by the deque&period; The destructor automatically frees any unused blocks (e&period;g&period;, in case an exception is thrown)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;deque&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE&lowbar;TYPE,
    class ALLOCATOR&gt;
class Deque&lowbar;BlockCreator;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/Deque_BlockCreator/2constructor.adoc[`Deque&lowbar;BlockCreator`]         [.small]#[constructor]#
| Construct a block allocator for the specified `deque`&period;
| xref:bsl/Deque_BlockCreator/2destructor.adoc[`&#126;Deque&lowbar;BlockCreator`] [.small]#[destructor]#
| Free any blocks that have been allocated by this allocator but have not yet been used by the deque&period;
| xref:bsl/Deque_BlockCreator/insertAtBack.adoc[`insertAtBack`] 
| Allocate the specified `n` blocks at the back of the block array&period; This method invalidates all iterators except `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;start` and `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;finish`&period;
| xref:bsl/Deque_BlockCreator/insertAtFront.adoc[`insertAtFront`] 
| Allocate the specified `n` blocks at the front of the block array&period; This method invalidates all iterators except `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;start` and `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;finish`&period;
| xref:bsl/Deque_BlockCreator/release.adoc[`release`] 
| Relinquish control over any allocated blocks&period; The destructor will do nothing following a call to this method&period;
| xref:bsl/Deque_BlockCreator/reserveBlockSlots.adoc[`reserveBlockSlots`] 
| Make room for the specified `numNewBlocks` pointers in the blocks array&period; If the specified `atFront` is `true`, then make room at the front of the array, else make room at the back of the array&period; Return a pointer to the insertion point, i&period;e&period;, the point where new blocks can be stored into the array, working backwards if `atFront` is `true`, or working forwards if `atFront` is `false`&period; This method invalidates all iterators and updates `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;start` and `d&lowbar;deque&lowbar;p&hyphen;&gt;d&lowbar;finish`&period;
|===



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