[#bsl-deque-0c-2constructor-05]
= xref:bsl.adoc[bsl]::xref:bsl/deque-0c.adoc[deque]::deque
:relfileprefix: ../../
:mrdocs:

Create a deque of `numElements` copies of `value`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
deque(
    xref:bsl/deque-0c/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

== Description

Create a deque of the specified `numElements` size whose every element has the specified `value`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not supplied, a default&hyphen;constructed object of the (template parameter) type `ALLOCATOR` is used&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma&colon;&colon;Allocator &ast;`&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used&period; Throw `bsl&colon;&colon;length&lowbar;error` if &grave;numElements &gt; max&lowbar;size()&grave;&period; This method requires that the (template parameter) `VALUE&lowbar;TYPE` be `copy&hyphen;insertable` into this deque (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| number of elements to create
| *value*
| value used to initialize each element
| *basicAllocator*
| allocator used to supply memory
|===


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