[#BloombergLP-bdlc-Queue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::Queue :relfileprefix: ../../ :mrdocs: Efficient, in‐place double‐ended queue of values of type `T`. == Synopsis Declared in `<bdlc_queue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class T> class Queue; ---- == Description This class implements an efficient, in‐place double‐ended queue of values of parameterized type `T`. The physical capacity of this queue may grow, but never shrinks. Capacity may be reserved initially via a constructor, or at any time thereafter by using the `reserveCapacity` and `reserveCapacityRaw` methods. Note that there is no guarantee of contiguous storage of consecutive elements. More generally, this container class supports a complete set of *value semantics* operations, including copy construction, assignment, equality comparison, `ostream` printing, and `bdex` serialization. (A precise operational definition of when two objects have the same value can be found in the description of `operator==` for the class.) This container is _exception neutral_ with no guarantee of rollback: if an exception is thrown during the invocation of a method on a pre‐existing object, the container is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, _aliasing_ (e.g., using all or part of an object as both source and destination) is supported in all cases. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/Queue/InitialCapacity.adoc[`InitialCapacity`] | Specifier for the initial internal capacity of a `Queue`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/Queue/2constructor-0d.adoc[`Queue`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlc/Queue/2destructor.adoc[`~Queue`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bdlc/Queue/operator_assign.adoc[`operator=`] | Assign to this queue the value of the specified `rhs` queue. | xref:BloombergLP/bdlc/Queue/append-0b.adoc[`append`] | `append` overloads | xref:BloombergLP/bdlc/Queue/back-07.adoc[`back`] | `back` overloads | xref:BloombergLP/bdlc/Queue/bdexStreamIn.adoc[`bdexStreamIn`] | Assign to this object the value read from the specified `stream`. | xref:BloombergLP/bdlc/Queue/bdexStreamOut.adoc[`bdexStreamOut`] | Write this object to the specified output `stream`. | xref:BloombergLP/bdlc/Queue/front-06.adoc[`front`] | `front` overloads | xref:BloombergLP/bdlc/Queue/insert-0f.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdlc/Queue/length.adoc[`length`] | Return the number of elements in this queue. | xref:BloombergLP/bdlc/Queue/operator_subs-02.adoc[`operator[]`] | Subscript operators | xref:BloombergLP/bdlc/Queue/popBack.adoc[`popBack`] | Remove the value from the back of this queue. | xref:BloombergLP/bdlc/Queue/popFront.adoc[`popFront`] | Remove the value from the front of this queue. | xref:BloombergLP/bdlc/Queue/print.adoc[`print`] | Format this object to the specified output `stream`. | xref:BloombergLP/bdlc/Queue/pushBack.adoc[`pushBack`] | Append the specified `item` to the back of this queue. | xref:BloombergLP/bdlc/Queue/pushFront.adoc[`pushFront`] | Insert the specified `item` into the front of this queue. | xref:BloombergLP/bdlc/Queue/remove-0f.adoc[`remove`] | `remove` overloads | xref:BloombergLP/bdlc/Queue/removeAll.adoc[`removeAll`] | Remove all elements from this queue. | xref:BloombergLP/bdlc/Queue/replace-0d.adoc[`replace`] | `replace` overloads | xref:BloombergLP/bdlc/Queue/reserveCapacity.adoc[`reserveCapacity`] | Reserve capacity for at least the specified `numElements` values. | xref:BloombergLP/bdlc/Queue/reserveCapacityRaw.adoc[`reserveCapacityRaw`] | Reserve minimal capacity for the specified `numElements` values. | xref:BloombergLP/bdlc/Queue/setLength-0b0.adoc[`setLength`] | `setLength` overloads | xref:BloombergLP/bdlc/Queue/setLengthRaw.adoc[`setLengthRaw`] | Set the length of this queue without initializing new elements. | xref:BloombergLP/bdlc/Queue/streamOut.adoc[`streamOut`] | Write the elements of this queue to the specified `stream`. | xref:BloombergLP/bdlc/Queue/swap.adoc[`swap`] | Swap the values at the specified indices `index1` and `index2`. | xref:BloombergLP/bdlc/Queue/2conversion-0c.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<Queue, HasPrintMethod>`] | Declare that this type has a `print` method. | xref:BloombergLP/bdlc/Queue/2conversion-04.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<Queue, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/Queue/maxSupportedBdexVersion-04.adoc[`maxSupportedBdexVersion`] | `maxSupportedBdexVersion` overloads | xref:BloombergLP/bdlc/Queue/maxSupportedVersion.adoc[`maxSupportedVersion`] | Return the most current `bdex` streaming version supported by this class. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/operator_not_eq-0f.adoc[`operator!=`] | Return whether the specified queues do not have the same value. | xref:BloombergLP/bdlc/operator_eq-0b.adoc[`operator==`] | Return whether the specified queues have the same value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#