[#BloombergLP-bdlc-Queue-setLength-0b0] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/Queue.adoc[Queue]::setLength :relfileprefix: ../../../ :mrdocs: `setLength` overloads == Synopses Declared in `<bdlc_queue.h>` Set the length of this queue to the specified `newLength`. If `newLength` is less than the current length, elements at index positions at or above `newLength` are removed. Otherwise any new elements (at or above the current length) are initialized to the specified `initialValue`, or to 0.0 if `initialValue` is not specified. The behavior is undefined unless `0 <= newLength`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bdlc/Queue/setLength-0bc.adoc[setLength](int newLength); ---- [.small]#xref:BloombergLP/bdlc/Queue/setLength-0bc.adoc[_» more..._]# Same as the preceding overload, initializing any new elements to the specified `initialValue`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bdlc/Queue/setLength-04.adoc[setLength]( int newLength, T const& initialValue); ---- [.small]#xref:BloombergLP/bdlc/Queue/setLength-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#