[#bsl-queue-0a5]
= xref:bsl.adoc[bsl]::queue
:relfileprefix: ../
:mrdocs:

FIFO queue adapter over a container of `VALUE` elements&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    class CONTAINER = xref:bsl/deque-0c.adoc[deque&lt;VALUE&gt;]&gt;
class queue;
----

== Description

This class is a value&hyphen;semantic class template, having a container of the parameterized `CONTAINER` type that holds elements of the parameterized `VALUE` type, to provide a first&hyphen;in&hyphen;first&hyphen;out queue data structure&period; The container object held by a `queue` class object is referenced as `c` in the following function&hyphen;level documentation&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/queue-0a5/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias to `CONTAINER&colon;&colon;const&lowbar;reference`&period;
| xref:bsl/queue-0a5/container_type.adoc[`container&lowbar;type`] 
| This `typedef` is an alias for the adapted container type&period;
| xref:bsl/queue-0a5/reference.adoc[`reference`] 
| This `typedef` is an alias to `CONTAINER&colon;&colon;reference`&period;
| xref:bsl/queue-0a5/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `CONTAINER&colon;&colon;size&lowbar;type`&period;
| xref:bsl/queue-0a5/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to `CONTAINER&colon;&colon;value&lowbar;type`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/queue-0a5/2constructor-09f.adoc[`queue`]         [.small]#[constructor]#
| Constructors
| xref:bsl/queue-0a5/operator_assign-04.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/queue-0a5/back-0d76.adoc[`back`] 
| `back` overloads
| xref:bsl/queue-0a5/emplace.adoc[`emplace`] 
| Emplace a newly constructed element onto the back of this queue&period;
| xref:bsl/queue-0a5/empty.adoc[`empty`] 
| Return `true` if this `queue` object contains no elements, and `false` otherwise&period; In effect, performs `return c&period;empty()&semi;`&period;
| xref:bsl/queue-0a5/front-06.adoc[`front`] 
| `front` overloads
| xref:bsl/queue-0a5/pop.adoc[`pop`] 
| Remove the front (the earliest pushed) element from this `queue` object&period;
| xref:bsl/queue-0a5/push-0c.adoc[`push`] 
| `push` overloads
| xref:bsl/queue-0a5/push_range.adoc[`push&lowbar;range`] 
| Push the elements of `range` onto the back of this queue&period;
| xref:bsl/queue-0a5/size.adoc[`size`] 
| Return the number of elements in this queue&period; In effect, performs `return c&period;size()&semi;`&period;
| xref:bsl/queue-0a5/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with `other`&period;
| xref:bsl/queue-0a5/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;queue, UsesBslmaAllocator, BloombergLP&colon;&colon;bslma&colon;&colon;UsesBslmaAllocator&lt;container&lowbar;type&gt;&colon;&colon;value&gt;`] 
| Declare that `queue` uses a `bslma` allocator when its container does&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:bsl/queue-0a5/c.adoc[`c`] 
| Contains the elements of this queue&period; This member is `protected` and named `c` per the C&plus;&plus;11 standard&period;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/queue-05.adoc[`queue&lt;TYPE&gt;`] 
| Deduce the template parameter `VALUE` from the parameters supplied to the constructor of `queue`&period;
| xref:bsl/queue-0aa.adoc[`queue&lt;TYPE, deque&lt;TYPE, ALLOCATOR&gt;&gt;`] 
| Deduce `VALUE` and `CONTAINER` from iterator&hyphen;pair and allocator arguments&period;
| xref:bsl/queue-0ad.adoc[`queue&lt;t&lowbar;TYPE, deque&lt;t&lowbar;TYPE, t&lowbar;ALLOCATOR&gt;&gt;`] 
| Deduce `VALUE` and `ALLOCATOR` from range and allocator arguments&period;
| xref:bsl/queue-09.adoc[`queue&lt;CONTAINER::value&lowbar;type, CONTAINER&gt;`] 
| Deduce `VALUE` and `CONTAINER` from a container constructor argument&period;
| xref:bsl/queue-0a3.adoc[`queue&lt;CONTAINER::value&lowbar;type, CONTAINER&gt;`] 
| Deduce `VALUE` and `CONTAINER` from container and allocator arguments&period;
| xref:bsl/queue-0c.adoc[`queue&lt;ranges::range&lowbar;value&lowbar;t&lt;t&lowbar;RANGE&gt;&gt;`] 
| Deduce the template parameter `VALUE` from the parameters supplied to the constructor of `queue`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/operator_3way-036.adoc[bsl::operator&lt;&equals;&gt;]`
| Return the three&hyphen;way comparison of the specified queues&semi; see the non&hyphen;member `operator&lt;&equals;&gt;` in the `bsl` namespace&period;
| `xref:bsl/operator_ge-0c.adoc[bsl::operator&gt;&equals;]`
| Return whether the specified queues compare lexicographically&semi; see the non&hyphen;member `operator&gt;&equals;` in the `bsl` namespace&period;
| `xref:bsl/operator_le-05.adoc[bsl::operator&lt;&equals;]`
| Return whether the specified queues compare lexicographically&semi; see the non&hyphen;member `operator&lt;&equals;` in the `bsl` namespace&period;
| `xref:bsl/operator_gt-0b7.adoc[bsl::operator&gt;]`
| Return whether the specified queues compare lexicographically&semi; see the non&hyphen;member `operator&gt;` in the `bsl` namespace&period;
| `xref:bsl/operator_lt-0e1.adoc[bsl::operator&lt;]`
| Return whether the specified queues compare lexicographically&semi; see the non&hyphen;member `operator&lt;` in the `bsl` namespace&period;
| `xref:bsl/operator_not_eq-08a.adoc[bsl::operator!&equals;]`
| Return whether the specified queues do not have the same value&semi; see the non&hyphen;member `operator!&equals;` in the `bsl` namespace&period;
| `xref:bsl/operator_eq-09b.adoc[bsl::operator&equals;&equals;]`
| Return whether the specified queues have the same value&semi; see the non&hyphen;member `operator&equals;&equals;` in the `bsl` namespace&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/operator_not_eq-0900.adoc[`operator!&equals;`]
| Return `true` if `lhs` and `rhs` do not have the same value&period;
| xref:bsl/operator_lt-0ef.adoc[`operator&lt;`]
| Return `true` if `lhs` is lexicographically less than `rhs`&period;
| xref:bsl/operator_le-09.adoc[`operator&lt;&equals;`]
| Return `true` if `lhs` is lexicographically less than or equal to `rhs`&period;
| xref:bsl/operator_3way-08d.adoc[`operator&lt;&equals;&gt;`]
| Return the three&hyphen;way comparison result of `lhs` and `rhs`&period;
| xref:bsl/operator_eq-0aef.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value&period;
| xref:bsl/operator_gt-09.adoc[`operator&gt;`]
| Return `true` if `lhs` is lexicographically greater than `rhs`&period;
| xref:bsl/operator_ge-07d.adoc[`operator&gt;&equals;`]
| Return `true` if `lhs` is lexicographically greater than or equal to `rhs`&period;
| xref:bsl/swap-020.adoc[`swap`]
| Swap the values of the specified `lhs` and `rhs` queues&period;
|===


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