Template Class bpq_iterator

Template Parameter Order

  1. typename _Tp

  2. typename Int

Class Documentation

template<typename _Tp, typename Int = int32_t>
class bpq_iterator

Bounded Priority Queue Iterator.

Bounded Priority Queue Iterator. Traverse the queue in descending order. Detaching queue items may invalidate the iterator because the iterator makes a copy of current key.

Public Functions

inline constexpr bpq_iterator(bpqueue<_Tp, Int> &bpq, UInt curkey)

Construct a new bpq iterator object.

Parameters
  • bpq[in]

  • curkey[in]

inline constexpr auto operator++() -> bpq_iterator&

move to the next item

Returns

bpq_iterator&

inline constexpr auto operator*() -> Item&

get the reference of the current item

Returns

bpq_iterator&

Friends

inline friend friend constexpr auto operator== (const bpq_iterator &lhs, const bpq_iterator &rhs) -> bool

eq operator

Parameters

rhs[in]

Returns

true

Returns

false

inline friend friend constexpr auto operator!= (const bpq_iterator &lhs, const bpq_iterator &rhs) -> bool

neq operator

Parameters

rhs[in]

Returns

true

Returns

false