[#BloombergLP-bdlc-Queue-setLength-0bc]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/Queue.adoc[Queue]::setLength
:relfileprefix: ../../../
:mrdocs:

Set the length of this queue to the specified `newLength`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setLength(int newLength);
----

== Description

Set the length of this queue to the specified `newLength`&period; If `newLength` is less than the current length, elements at index positions at or above `newLength` are removed&period; Otherwise any new elements (at or above the current length) are initialized to the specified `initialValue`, or to 0&period;0 if `initialValue` is not specified&period; The behavior is undefined unless `0 &lt;&equals; newLength`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *newLength*
| desired length of this queue
|===


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