std::priority_queue
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <queue> 中定义
|
||
| template< class T, |
||
优先级队列是一个容器,它允许为恒定的时间的最大(或最小,取决于
Compare)在对数插入牺牲萃取。工作用priority_queue类似管理堆在一些随机接入容器,与不能够意外失效堆的利益.原文:
Priority queue is a container that allows for constant time maximum (or minimum, depending on
Compare) extraction at the expense of logarithmic insertion. Working with a priority_queue is similar to managing a 堆 in some random access container, with the benefit of not being able to accidentally invalidate the heap.目录 |
[编辑] 会员类型
| 会员类型
|
Definition |
container_type
|
Container
|
value_type
|
Container::value_type
|
size_type
|
Container::size_type
|
reference
|
Container::reference
|
const_reference
|
Container::const_reference
|
[编辑] 成员函数
| 构建 priority_queue (公共成员函数) | |
析构 priority_queue (公共成员函数) | |
| 将值指派给容器适配器 原文: assigns values to the container adaptor (公共成员函数) | |
| |
| 访问的顶级元素 (公共成员函数) | |
| |
| 检查是否有潜在的容器是空的 原文: checks whether the underlying container is empty (公共成员函数) | |
| 返回的元素数 (公共成员函数) | |
| |
| inserts element and sorts the underlying container (公共成员函数) | |
| (C++11) |
constructs element in-place and sorts the underlying container (公共成员函数) |
| 删除第一个元素 (公共成员函数) | |
交换priority_queue的内容 (公共成员函数) | |
| |
| Container c |
基础容器 (受保护的成员对象) |
| Compare comp |
比较函数对象 (受保护的成员对象) |
[编辑] 非成员函数
| 特化std::swap算法 (函数模板) | |
[编辑] Helper类
| 专业的std::uses_allocator型特征 原文: specializes the std::uses_allocator type trait (函数模板) | |