[#bsl-priority_queue-034-2constructor-0d7] = xref:bsl.adoc[bsl]::xref:bsl/priority_queue-034.adoc[priority_queue]::priority_queue :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_priorityqueue.h>` Create an empty priority queue, adapting a default‐constructed container of the (template parameter) type `CONTAINER`. Use a default‐constructed comparator of the (template parameter) type `COMPARATOR` to order elements in the priority queue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/priority_queue-034/2constructor-04.adoc[priority_queue](); ---- [.small]#xref:bsl/priority_queue-034/2constructor-04.adoc[_» more..._]# Create a priority queue having the same value as the specified `original` object. Use a copy of the comparator from `original` to order elements in the priority queue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/priority_queue-034/2constructor-02f.adoc[priority_queue](xref:bsl/priority_queue-034.adoc[priority_queue] const& original); ---- [.small]#xref:bsl/priority_queue-034/2constructor-02f.adoc[_» more..._]# Create a priority queue having the same value as the specified `original` object. Use a copy of the comparator from `original` to order elements in the priority queue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/priority_queue-034/2constructor-073.adoc[priority_queue](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<priority_queue>] original); ---- [.small]#xref:bsl/priority_queue-034/2constructor-073.adoc[_» more..._]# Create an empty priority queue, adapting a default‐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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/priority_queue-034/2constructor-0aa.adoc[priority_queue](COMPARATOR const& comparator); ---- [.small]#xref:bsl/priority_queue-034/2constructor-0aa.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/priority_queue-034/2constructor-098.adoc[priority_queue]( COMPARATOR const& comparator, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container); ---- [.small]#xref:bsl/priority_queue-034/2constructor-098.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/priority_queue-034/2constructor-0a5.adoc[priority_queue]( COMPARATOR const& comparator, CONTAINER const& container); ---- [.small]#xref:bsl/priority_queue-034/2constructor-0a5.adoc[_» more..._]# Create a priority queue, adapting a default‐constructed container of the (template parameter) type `CONTAINER`, and inserting into the container a sequence of `value_type` elements that starts at the specified `first` and ends immediately before the specified `last`. Use a default‐constructed comparator of the (template parameter) type `COMPARATOR` to order elements in the priority queue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/priority_queue-034/2constructor-0dc.adoc[priority_queue]( INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:bsl/priority_queue-034/2constructor-0dc.adoc[_» more..._]# Create an empty priority queue, adapting a default‐constructed container of the (template parameter) type `CONTAINER` that uses the specified `basicAllocator` to supply memory. Use a default‐constructed object of the (template parameter) type `COMPARATOR` to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> explicit xref:bsl/priority_queue-034/2constructor-00.adoc[priority_queue]( ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-00.adoc[_» more..._]# Create a priority queue from the elements of the specified `range`. Optionally specify a `comparator` used to order elements in the priority queue. Optionally supply an `allocator` to supply memory. If `allocator` is not supplied and if `CONTAINER` is allocator aware, the currently installed default allocator is used. 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`. Also note that the constructor overloads that take allocators are defined only if the underlying `CONTAINTER` is allocator aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_RANGE> xref:bsl/priority_queue-034/2constructor-03d.adoc[priority_queue]( std::from_range_t, t_RANGE&& range, COMPARATOR const& comparator = COMPARATOR()); ---- [.small]#xref:bsl/priority_queue-034/2constructor-03d.adoc[_» more..._]# Create a priority queue having the same value as the specified `original` object and using the specified `basicAllocator` to supply memory. Use a copy of the comparator from `original` to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/priority_queue-034/2constructor-03f.adoc[priority_queue]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<priority_queue>] original, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-03f.adoc[_» more..._]# Create an empty priority queue, adapting a default‐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. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/priority_queue-034/2constructor-0f.adoc[priority_queue]( COMPARATOR const& comparator, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-0f.adoc[_» more..._]# Create a priority queue having the same value as the specified `original` object and using the specified `basicAllocator` to supply memory. Use a copy of the comparator from `original` to order elements in the priority queue. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/priority_queue-034/2constructor-0b.adoc[priority_queue]( xref:bsl/priority_queue-034.adoc[priority_queue] const& original, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-0b.adoc[_» more..._]# 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_type` elements starting at the specified `first`, and ending immediately before the specified `last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/priority_queue-034/2constructor-021.adoc[priority_queue]( INPUT_ITERATOR first, INPUT_ITERATOR last, COMPARATOR const& comparator, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container); ---- [.small]#xref:bsl/priority_queue-034/2constructor-021.adoc[_» more..._]# 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_type` elements starting at the specified `first`, and ending immediately before the specified `last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/priority_queue-034/2constructor-030.adoc[priority_queue]( INPUT_ITERATOR first, INPUT_ITERATOR last, COMPARATOR const& comparator, CONTAINER const& container); ---- [.small]#xref:bsl/priority_queue-034/2constructor-030.adoc[_» more..._]# 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. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/priority_queue-034/2constructor-074.adoc[priority_queue]( COMPARATOR const& comparator, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<CONTAINER>] container, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-074.adoc[_» more..._]# 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. Note that this constructor is only defined if the underlying container uses allocator. Otherwise this constructor is disabled. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> xref:bsl/priority_queue-034/2constructor-093.adoc[priority_queue]( COMPARATOR const& comparator, CONTAINER const& container, ALLOCATOR const& basicAllocator, ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-093.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_RANGE, class t_ALLOCATOR> xref:bsl/priority_queue-034/2constructor-06.adoc[priority_queue]( std::from_range_t, t_RANGE&& range, t_ALLOCATOR const& allocator, t_ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, t_ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-06.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_RANGE, class t_ALLOCATOR> xref:bsl/priority_queue-034/2constructor-05.adoc[priority_queue]( std::from_range_t, t_RANGE&& range, COMPARATOR const& comparator, t_ALLOCATOR const& allocator, t_ALLOCATOR* = 0) requires bsl::uses_allocator<CONTAINER, t_ALLOCATOR>::value; ---- [.small]#xref:bsl/priority_queue-034/2constructor-05.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#