__GNU_PBDS::PRIORITY_QUEUE(3cxx)
π NAME π
__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > β bestie, this is the libstdc++ (section 3cxx) priority queue that lets you pick which heap policy it runs on. Main character container energy fr fr π
β¨ SYNOPSIS β¨
#include <priority_queue.hpp>
Lowkey important: it inherits detail::container_base_dispatch::type. That's the whole inheritance situation, no cap π«Ά
πΈ Public Types πΈ
typedef _Alloc allocator_typetypedef Cmp_Fn cmp_fntypedef base_type::const_iterator const_iteratortypedef __rebind_va::const_pointer const_pointertypedef __rebind_va::const_reference const_referencetypedef Tag container_categorytypedef allocator_type::difference_type difference_typetypedef base_type::iterator iteratortypedef base_type::point_const_iterator point_const_iteratortypedef base_type::point_iterator point_iteratortypedef __rebind_va::pointer pointertypedef __rebind_va::reference referencetypedef allocator_type::size_type size_typetypedef _Tv value_type
That's fourteen typedefs and yes, we're listing every single one, because the details are the moment π
π Public Member Functions π
priority_queue (const cmp_fn &r_cmp_fn)β constructor that takes your policy objects.r_cmp_fngets copied by theCmp_Fnobject of the container object. π§priority_queue (const priority_queue &other)β the copy constructor, doing copy-constructor things, iconic behaviour only.template<typename It > priority_queue (It first_it, It last_it)β constructor that takes iterators to a range ofvalue_types. Everything betweenfirst_itandlast_itgets inserted into the container object. π¦template<typename It > priority_queue (It first_it, It last_it, const cmp_fn &r_cmp_fn)β same iterator-range deal plus policy objects: thevalue_types betweenfirst_itandlast_itget inserted into the container object, andr_cmp_fngets copied by thecmp_fnobject of the container object. πpriority_queue & operator= (const priority_queue &other)β assignment, slay.void swap (priority_queue &other)β swaps withother. That's the whole vibe check. π₯
π Detailed Description π
template<typename _Tv, typename Cmp_Fn = std::less<_Tv>, typename Tag =
pairing_heap_tag, typename _Alloc = std::allocator<char>>
class __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >
It's giving "a priority queue composed of one specific heap policy." Like, literally exactly that. π
Template Parameters
_Tvβ value type.Cmp_Fnβ comparison functor.Tagβ instantiating data structure type, seecontainer_tag._Allocβ allocator type.
Base is dispatched at compile time via Tag, from the following choices: binary_heap_tag, binomial_heap_tag, pairing_heap_tag, rc_binomial_heap_tag, thin_heap_tag β
Base choices are: detail::binary_heap, detail::binomial_heap, detail::pairing_heap, detail::rc_binomial_heap, detail::thin_heap. Pick your fighter ππ
π§ Constructor & Destructor Documentation π§
priority_queue (const cmp_fn & r_cmp_fn) β inline
template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag =
pairing_heap_tag, typename _Alloc = std::allocator<char>>
__gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc >::priority_queue
(const cmp_fn & r_cmp_fn) [inline]
Constructor taking some policy objects. r_cmp_fn will be copied by the Cmp_Fn object of the container object. Obsessed with this for us π
priority_queue (It first_it, It last_it) β inline
template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag =
pairing_heap_tag, typename _Alloc = std::allocator<char>>
template<typename It > __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag,
_Alloc >::priority_queue (It first_it, It last_it) [inline]
Constructor taking __iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object. Range-based and flawless πΈ
priority_queue (It first_it, It last_it, const cmp_fn & r_cmp_fn) β inline
template<typename _Tv , typename Cmp_Fn = std::less<_Tv>, typename Tag =
pairing_heap_tag, typename _Alloc = std::allocator<char>>
template<typename It > __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag,
_Alloc >::priority_queue (It first_it, It last_it, const cmp_fn &
r_cmp_fn) [inline]
Constructor taking __iterators to a range of value_types and some policy objects. The value_types between first_it and last_it will be inserted into the container object. r_cmp_fn will be copied by the cmp_fn object of the container object. Both at once? Ate. β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing its little robot thing π€π«
Ok that's the whole page bestie, nothing skipped, we ate and left no crumbs ππ
Sign-off time: this gorgeous little page comes from libstdc++, generated automatically by Doxygen straight from the source code, and it lives in manual section 3cxx β the __gnu_pbds::priority_queue< _Tv, Cmp_Fn, Tag, _Alloc > page. Go build something iconic with it πππ¦
π¦ where this page comes from
- debian trixie: libstdc++-12-doc 12.4.0-5
- debian trixie: libstdc++-13-doc 13.3.0-16
- debian trixie: libstdc++-14-doc 14.2.0-19
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2.1
- ubuntu noble: libstdc++-11-doc 11.4.0-9ubuntu1
- ubuntu noble: libstdc++-11-doc 11.5.0-1ubuntu1~24.04.1
- ubuntu noble: libstdc++-12-doc 12.3.0-17ubuntu1
- ubuntu noble: libstdc++-12-doc 12.4.0-2ubuntu1~24.04.1
- ubuntu noble: libstdc++-13-doc 13.2.0-23ubuntu4
- ubuntu noble: libstdc++-13-doc 13.3.0-6ubuntu2~24.04.1
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ubuntu noble: libstdc++-14-doc 14.2.0-4ubuntu2~24.04.1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1.1
- ubuntu questing: libstdc++-12-doc 12.5.0-6ubuntu1
- ubuntu questing: libstdc++-13-doc 13.4.0-4ubuntu1
- ubuntu questing: libstdc++-14-doc 14.3.0-8ubuntu1
- ubuntu questing: libstdc++-15-doc 15.2.0-4ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms