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.

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.

priority_queue(priority_queue const& original);

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.

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.

explicit
priority_queue(COMPARATOR const& comparator);

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.

explicit
priority_queue(
    COMPARATOR const& comparator,
    BloombergLP::bslmf::MovableRef<CONTAINER> container);

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.

priority_queue(
    COMPARATOR const& comparator,
    CONTAINER const& container);

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.

template<class INPUT_ITERATOR>
priority_queue(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last);

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.

template<class ALLOCATOR>
explicit
priority_queue(
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

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.

template<class t_RANGE>
priority_queue(
    std::from_range_t,
    t_RANGE&& range,
    COMPARATOR const& comparator = COMPARATOR());

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.

template<class ALLOCATOR>
priority_queue(
    BloombergLP::bslmf::MovableRef<priority_queue> original,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

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.

template<class ALLOCATOR>
priority_queue(
    COMPARATOR const& comparator,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

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.

template<class ALLOCATOR>
priority_queue(
    priority_queue const& original,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

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.

template<class INPUT_ITERATOR>
priority_queue(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    COMPARATOR const& comparator,
    BloombergLP::bslmf::MovableRef<CONTAINER> container);

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.

template<class INPUT_ITERATOR>
priority_queue(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    COMPARATOR const& comparator,
    CONTAINER const& container);

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.

template<class ALLOCATOR>
priority_queue(
    COMPARATOR const& comparator,
    BloombergLP::bslmf::MovableRef<CONTAINER> container,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

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.

template<class ALLOCATOR>
priority_queue(
    COMPARATOR const& comparator,
    CONTAINER const& container,
    ALLOCATOR const& basicAllocator,
    ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER, ALLOCATOR>::value;

Same as the preceding overload.

template<
    class t_RANGE,
    class t_ALLOCATOR>
priority_queue(
    std::from_range_t,
    t_RANGE&& range,
    t_ALLOCATOR const& allocator,
    t_ALLOCATOR* = 0)
requires bsl::uses_allocator<CONTAINER,
                                                          t_ALLOCATOR>::value;

Same as the preceding overload.

template<
    class t_RANGE,
    class t_ALLOCATOR>
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;

Created with MrDocs