[#BloombergLP-bdlc-Queue-2constructor-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/Queue.adoc[Queue]::Queue
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bdlc&lowbar;queue&period;h&gt;`

Create an in&hyphen;place queue&period; By default, the queue is empty&period; Optionally specify the `initialLength` of the queue&period; Queue elements are initialized with the specified `initialValue`, or to 0&period;0 if `initialValue` is not specified&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `0 &lt;&equals; initialLength`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlc/Queue/2constructor-027f.adoc[Queue](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-027f.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, creating a queue of the specified `initialLength` with elements value&hyphen;initialized&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlc/Queue/2constructor-045.adoc[Queue](
    unsigned int initialLength,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-045.adoc[_» more&period;&period;&period;_]#

Create an in&hyphen;place queue with sufficient initial capacity to accommodate up to the specified `numElements` values without subsequent reallocation&period; A valid reference returned by the `operator&lsqb;&rsqb;` method is guaranteed to remain valid unless the value returned by the `length` method exceeds `numElements` (which would potentially cause a reallocation)&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `0 &lt;&equals; numElements`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlc/Queue/2constructor-0a.adoc[Queue](
    xref:BloombergLP/bdlc/Queue/InitialCapacity.adoc[InitialCapacity] const& numElements,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Create an in&hyphen;place queue initialized to the value of the specified `original` queue&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/Queue/2constructor-0273.adoc[Queue](
    xref:BloombergLP/bdlc/Queue.adoc[Queue] const& original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-0273.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, initializing each element to the specified `initialValue`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/Queue/2constructor-04b.adoc[Queue](
    int initialLength,
    T const& initialValue,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-04b.adoc[_» more&period;&period;&period;_]#

Create an in&hyphen;place queue initialized with the specified `numElements` leading values from the specified `srcArray`&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `0 &lt;&equals; numElements`&period; Note that `srcArray` must refer to sufficient memory to hold `numElements` values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/Queue/2constructor-02d.adoc[Queue](
    T const* srcArray,
    int numElements,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/Queue/2constructor-02d.adoc[_» more&period;&period;&period;_]#


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