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

Constructors

== Synopses

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

Create an empty queue having a container of the parameterized `CONTAINER` type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/queue-0a5/2constructor-0cd.adoc[queue]();
----

[.small]#xref:bsl/queue-0a5/2constructor-0cd.adoc[_» more&period;&period;&period;_]#

Create a queue having the value of the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/queue-0a5/2constructor-0e.adoc[queue](xref:bsl/queue-0a5.adoc[queue] const& original);
----

[.small]#xref:bsl/queue-0a5/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Create a queue having the same sequence of values as the specified `container`&period; The allocator associated with `container` (if any) is propagated for use in the new queue&period; `container` is left in valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/queue-0a5/2constructor-0f0.adoc[queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container);
----

[.small]#xref:bsl/queue-0a5/2constructor-0f0.adoc[_» more&period;&period;&period;_]#

Create a queue having the value of the specified `original`&period; The allocator associated with `original` (if any) is propagated for use in the new queue&period; `original` is left in valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/queue-0a5/2constructor-06.adoc[queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;queue&gt;] container);
----

[.small]#xref:bsl/queue-0a5/2constructor-06.adoc[_» more&period;&period;&period;_]#

Create a queue having the specified `container` that holds elements of the parameterized `VALUE` type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/queue-0a5/2constructor-09a.adoc[queue](CONTAINER const& container);
----

[.small]#xref:bsl/queue-0a5/2constructor-09a.adoc[_» more&period;&period;&period;_]#

Create a queue passing the specified `first` and `last` to the constructor of the underlying container&period; Optionally specify an `allocator` used to supply memory&period; If `allocator` is not specified, a default&hyphen;constructed object of the (template parameter) type `ALLOCATOR` is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITER&gt;
xref:bsl/queue-0a5/2constructor-0fcd.adoc[queue](
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last);
----

[.small]#xref:bsl/queue-0a5/2constructor-0fcd.adoc[_» more&period;&period;&period;_]#

Create a queue from the elements of the specifed `range`&period; Optionally specify an `allocator` used to supply memory&period; If `allocator` is not specified, a default&hyphen;constructed object of the (template parameter) type `t&lowbar;ALLOCATOR` is used&period; Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `VALUE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;RANGE&gt;
xref:bsl/queue-0a5/2constructor-0fc5.adoc[queue](
    std::from&lowbar;range&lowbar;t,
    t&lowbar;RANGE&& range);
----

[.small]#xref:bsl/queue-0a5/2constructor-0fc5.adoc[_» more&period;&period;&period;_]#

Create an empty queue&period; This queue object uses the specified `basicAllocator` to supply memory&period; Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER&colon;&colon;allocator&lowbar;type`&semi; otherwise, this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
explicit
xref:bsl/queue-0a5/2constructor-01.adoc[queue](
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-01.adoc[_» more&period;&period;&period;_]#

Create a queue whose underlying container has the value of the specified `container` (on entry) and uses `basicAllocator` to supply memory&period; The allocated&hyphen;extended move constructor of `CONTAINER` is used to create the new queue&period; `container` is left in a valid but unspecified state&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period; Also note that this method assumes that `CONTAINER` has a move constructor&period; Also note that if `CONTAINER&colon;&colon;allocator&lowbar;type` does not exist, this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-054.adoc[queue](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-054.adoc[_» more&period;&period;&period;_]#

Create a queue having the value of the specified `original` (on entry), that uses `basicAllocator` to supply memory&period; The allocator&hyphen;extended move constructor of `CONTAINER` is used to create the new queue&period; `original` is left in a valid but unspecified state&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period; Also note that this method assumes that `CONTAINER` has a move constructor&period; Also note that if `CONTAINER&colon;&colon;allocator&lowbar;type` does not exist, this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-056.adoc[queue](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;queue&gt;] original,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-056.adoc[_» more&period;&period;&period;_]#

Create a queue having the same sequence of values as the specified `container`&period; The queue object uses the specified `basicAllocator` to obtain memory&period; Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER&colon;&colon;allocator&lowbar;type`&semi; otherwise, this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-09d.adoc[queue](
    CONTAINER const& container,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-09d.adoc[_» more&period;&period;&period;_]#

Create a queue having the value of the specified `original` that will use the specified `basicAllocator` to supply memory&period; Note that the `ALLOCATOR` parameter type has to be convertible to the allocator of the `CONTAINER` parameter type, `CONTAINER&colon;&colon;allocator&lowbar;type`&period; Otherwise this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-0cc.adoc[queue](
    xref:bsl/queue-0a5.adoc[queue] const& original,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-0cc.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class INPUT&lowbar;ITER,
    class ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-0b.adoc[queue](
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last,
    ALLOCATOR const& allocator,
    ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER, ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-0b.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;RANGE,
    class t&lowbar;ALLOCATOR&gt;
xref:bsl/queue-0a5/2constructor-0f5.adoc[queue](
    std::from&lowbar;range&lowbar;t,
    t&lowbar;RANGE&& range,
    t&lowbar;ALLOCATOR const& allocator,
    t&lowbar;ALLOCATOR* = 0)
requires bsl&colon;&colon;uses&lowbar;allocator&lt;CONTAINER,t&lowbar;ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:bsl/queue-0a5/2constructor-0f5.adoc[_» more&period;&period;&period;_]#


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