[#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 `<bdlc_queue.h>` Create an in‐place queue. By default, the queue is empty. Optionally specify the `initialLength` of the queue. Queue elements are initialized with the specified `initialValue`, or to 0.0 if `initialValue` is not specified. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The behavior is undefined unless `0 <= initialLength`. [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..._]# Same as the preceding overload, creating a queue of the specified `initialLength` with elements value‐initialized. [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..._]# Create an in‐place queue with sufficient initial capacity to accommodate up to the specified `numElements` values without subsequent reallocation. A valid reference returned by the `operator[]` method is guaranteed to remain valid unless the value returned by the `length` method exceeds `numElements` (which would potentially cause a reallocation). Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The behavior is undefined unless `0 <= numElements`. [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..._]# Create an in‐place queue initialized to the value of the specified `original` queue. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. [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..._]# Same as the preceding overload, initializing each element to the specified `initialValue`. [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..._]# Create an in‐place queue initialized with the specified `numElements` leading values from the specified `srcArray`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The behavior is undefined unless `0 <= numElements`. Note that `srcArray` must refer to sufficient memory to hold `numElements` values. [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..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#