[#bsl-priority_queue-034-2constructor-0d7]
= xref:bsl.adoc[bsl]::xref:bsl/priority_queue-034.adoc[priority&lowbar;queue]::priority&lowbar;queue
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an empty priority queue, adapting a default&hyphen;constructed container of the (template parameter) type `CONTAINER`&period; Use a default&hyphen;constructed comparator of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/priority_queue-034/2constructor-04.adoc[priority&lowbar;queue]();
----

[.small]#xref:bsl/priority_queue-034/2constructor-04.adoc[_» more&period;&period;&period;_]#

Create a priority queue having the same value as the specified `original` object&period; Use a copy of the comparator from `original` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/priority_queue-034/2constructor-02f.adoc[priority&lowbar;queue](xref:bsl/priority_queue-034.adoc[priority&lowbar;queue] const& original);
----

[.small]#xref:bsl/priority_queue-034/2constructor-02f.adoc[_» more&period;&period;&period;_]#

Create a priority queue having the same value as the specified `original` object&period; Use a copy of the comparator from `original` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/priority_queue-034/2constructor-073.adoc[priority&lowbar;queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;priority&lowbar;queue&gt;] original);
----

[.small]#xref:bsl/priority_queue-034/2constructor-073.adoc[_» more&period;&period;&period;_]#

Create an empty priority queue, adapting a default&hyphen;constructed container of the (template parameter) type `CONTAINER`, and having the specified `comparator` of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/priority_queue-034/2constructor-0aa.adoc[priority&lowbar;queue](COMPARATOR const& comparator);
----

[.small]#xref:bsl/priority_queue-034/2constructor-0aa.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container` of the (template parameter) type `CONTAINER`, and having the specified `comparator` of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/priority_queue-034/2constructor-098.adoc[priority&lowbar;queue](
    COMPARATOR const& comparator,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container);
----

[.small]#xref:bsl/priority_queue-034/2constructor-098.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container` of the (template parameter) type `CONTAINER`, and having the specified `comparator` of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/priority_queue-034/2constructor-0a5.adoc[priority&lowbar;queue](
    COMPARATOR const& comparator,
    CONTAINER const& container);
----

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

Create a priority queue, adapting a default&hyphen;constructed container of the (template parameter) type `CONTAINER`, and inserting into the container a sequence of `value&lowbar;type` elements that starts at the specified `first` and ends immediately before the specified `last`&period; Use a default&hyphen;constructed comparator of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period;


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

[.small]#xref:bsl/priority_queue-034/2constructor-0dc.adoc[_» more&period;&period;&period;_]#

Create an empty priority queue, adapting a default&hyphen;constructed container of the (template parameter) type `CONTAINER` that uses the specified `basicAllocator` to supply memory&period; Use a default&hyphen;constructed object of the (template parameter) type `COMPARATOR` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


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

[.small]#xref:bsl/priority_queue-034/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create a priority queue from the elements of the specified `range`&period; Optionally specify a `comparator` used to order elements in the priority queue&period; Optionally supply an `allocator` to supply memory&period; If `allocator` is not supplied and if `CONTAINER` is allocator aware, the currently installed default allocator is used&period; Note that `range` must (minimally) meet the requirements of an input range and the values from the range must have a type matching or convertible to (template parameter) `VALUE`&period; Also note that the constructor overloads that take allocators are defined only if the underlying `CONTAINTER` is allocator aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;RANGE&gt;
xref:bsl/priority_queue-034/2constructor-03d.adoc[priority&lowbar;queue](
    std::from&lowbar;range&lowbar;t,
    t&lowbar;RANGE&& range,
    COMPARATOR const& comparator = COMPARATOR());
----

[.small]#xref:bsl/priority_queue-034/2constructor-03d.adoc[_» more&period;&period;&period;_]#

Create a priority queue having the same value as the specified `original` object and using the specified `basicAllocator` to supply memory&period; Use a copy of the comparator from `original` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/priority_queue-034/2constructor-03f.adoc[priority&lowbar;queue](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;priority&lowbar;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/priority_queue-034/2constructor-03f.adoc[_» more&period;&period;&period;_]#

Create an empty priority queue, adapting a default&hyphen;constructed container of the (template parameter) type `CONTAINER` that uses the specified `basicAllocator` to supply memory, and the specified `comparator` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


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

[.small]#xref:bsl/priority_queue-034/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create a priority queue having the same value as the specified `original` object and using the specified `basicAllocator` to supply memory&period; Use a copy of the comparator from `original` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/priority_queue-034/2constructor-0b.adoc[priority&lowbar;queue](
    xref:bsl/priority_queue-034.adoc[priority&lowbar;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/priority_queue-034/2constructor-0b.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container`, having the specified `comparator` to order elements in the priority queue, including those originally existed in `container`, and those inserted into the `container` from a sequence of `value&lowbar;type` elements starting at the specified `first`, and ending immediately before the specified `last`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/priority_queue-034/2constructor-021.adoc[priority&lowbar;queue](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    COMPARATOR const& comparator,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;CONTAINER&gt;] container);
----

[.small]#xref:bsl/priority_queue-034/2constructor-021.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container`, having the specified `comparator` to order the priorities of elements, including those originally existed in `container`, and those inserted into the `container` from a sequence of `value&lowbar;type` elements starting at the specified `first`, and ending immediately before the specified `last`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/priority_queue-034/2constructor-030.adoc[priority&lowbar;queue](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    COMPARATOR const& comparator,
    CONTAINER const& container);
----

[.small]#xref:bsl/priority_queue-034/2constructor-030.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container` that uses the specified `basicAllocator` to supply memory, and the specified `comparator` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/priority_queue-034/2constructor-074.adoc[priority&lowbar;queue](
    COMPARATOR const& comparator,
    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/priority_queue-034/2constructor-074.adoc[_» more&period;&period;&period;_]#

Create a priority queue, adapting the specified `container` that uses the specified `basicAllocator` to supply memory, and the specified `comparator` to order elements in the priority queue&period; Note that this constructor is only defined if the underlying container uses allocator&period; Otherwise this constructor is disabled&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALLOCATOR&gt;
xref:bsl/priority_queue-034/2constructor-093.adoc[priority&lowbar;queue](
    COMPARATOR const& comparator,
    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/priority_queue-034/2constructor-093.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/priority_queue-034/2constructor-06.adoc[priority&lowbar;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/priority_queue-034/2constructor-06.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/priority_queue-034/2constructor-05.adoc[priority&lowbar;queue](
    std::from&lowbar;range&lowbar;t,
    t&lowbar;RANGE&& range,
    COMPARATOR const& comparator,
    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/priority_queue-034/2constructor-05.adoc[_» more&period;&period;&period;_]#


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