WPILibC++ 2024.3.2
wpi::priority_queue< T, Sequence, Compare > Class Template Reference

This class is the same as std::priority_queue with two changes: More...

#include <wpi/priority_queue.h>

Public Types

using value_type = typename Sequence::value_type
 
using reference = typename Sequence::reference
 
using const_reference = typename Sequence::const_reference
 
using size_type = typename Sequence::size_type
 
using container_type = Sequence
 
using value_compare = Compare
 

Public Member Functions

template<typename Seq = Sequence>
requires std::default_initializable<Compare> && std::default_initializable<Seq>
 priority_queue ()
 
 priority_queue (const Compare &comp, const Sequence &c)
 
 priority_queue (const Compare &comp, Sequence &&c=Sequence{})
 
template<typename InputIterator >
 priority_queue (InputIterator first, InputIterator last, const Compare &comp, const Sequence &c)
 
template<typename InputIterator >
 priority_queue (InputIterator first, InputIterator last, const Compare &comp=Compare{}, Sequence &&c=Sequence{})
 
bool empty () const
 
size_type size () const
 
const_reference top () const
 
void push (const value_type &value)
 
void push (value_type &&value)
 
template<typename... Args>
void emplace (Args &&... args)
 
pop ()
 
bool remove (const T &value)
 

Protected Attributes

Sequence c
 
Compare comp
 

Detailed Description

template<typename T, typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
requires std::same_as<T, typename Sequence::value_type>
class wpi::priority_queue< T, Sequence, Compare >

This class is the same as std::priority_queue with two changes:

  1. Adds a remove() function for removing all elements from the priority queue that match the given value.
  2. Replaces "void pop()" with "T pop()" so the element can be moved from the queue directly instead of copied from top().

Member Typedef Documentation

◆ const_reference

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::const_reference = typename Sequence::const_reference

◆ container_type

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::container_type = Sequence

◆ reference

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::reference = typename Sequence::reference

◆ size_type

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::size_type = typename Sequence::size_type

◆ value_compare

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::value_compare = Compare

◆ value_type

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
using wpi::priority_queue< T, Sequence, Compare >::value_type = typename Sequence::value_type

Constructor & Destructor Documentation

◆ priority_queue() [1/5]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
template<typename Seq = Sequence>
requires std::default_initializable<Compare> && std::default_initializable<Seq>
wpi::priority_queue< T, Sequence, Compare >::priority_queue ( )
inline

◆ priority_queue() [2/5]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
wpi::priority_queue< T, Sequence, Compare >::priority_queue ( const Compare &  comp,
const Sequence &  c 
)
inline

◆ priority_queue() [3/5]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
wpi::priority_queue< T, Sequence, Compare >::priority_queue ( const Compare &  comp,
Sequence &&  c = Sequence{} 
)
inlineexplicit

◆ priority_queue() [4/5]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
template<typename InputIterator >
wpi::priority_queue< T, Sequence, Compare >::priority_queue ( InputIterator  first,
InputIterator  last,
const Compare &  comp,
const Sequence &  c 
)
inline

◆ priority_queue() [5/5]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
template<typename InputIterator >
wpi::priority_queue< T, Sequence, Compare >::priority_queue ( InputIterator  first,
InputIterator  last,
const Compare &  comp = Compare{},
Sequence &&  c = Sequence{} 
)
inline

Member Function Documentation

◆ emplace()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
template<typename... Args>
void wpi::priority_queue< T, Sequence, Compare >::emplace ( Args &&...  args)
inline

◆ empty()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
bool wpi::priority_queue< T, Sequence, Compare >::empty ( ) const
inline

◆ pop()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
T wpi::priority_queue< T, Sequence, Compare >::pop ( )
inline

◆ push() [1/2]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
void wpi::priority_queue< T, Sequence, Compare >::push ( const value_type value)
inline

◆ push() [2/2]

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
void wpi::priority_queue< T, Sequence, Compare >::push ( value_type &&  value)
inline

◆ remove()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
bool wpi::priority_queue< T, Sequence, Compare >::remove ( const T &  value)
inline

◆ size()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
size_type wpi::priority_queue< T, Sequence, Compare >::size ( ) const
inline

◆ top()

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
const_reference wpi::priority_queue< T, Sequence, Compare >::top ( ) const
inline

Member Data Documentation

◆ c

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
Sequence wpi::priority_queue< T, Sequence, Compare >::c
protected

◆ comp

template<typename T , typename Sequence = std::vector<T>, typename Compare = std::less<typename Sequence::value_type>>
Compare wpi::priority_queue< T, Sequence, Compare >::comp
protected

The documentation for this class was generated from the following file: