template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> > class priority_queue;
bool 值。comp(a,b),其中 comp 是此类型的对象,a 和 b 是容器中的元素,如果 a 在该函数定义的严格弱序中被认为排在 b 之前,则应返回 true。less<T>,其返回值与应用小于运算符(a<b)相同。| 成员类型 | 定义 | 说明 |
|---|---|---|
| value_type | 第一个模板参数 (T) | 元素的类型 |
| container_type | 第二个模板参数 (Container) | 底层容器的类型 |
| size_type | 一个无符号整数类型 | 通常与 size_t 相同 |
| 成员类型 | 定义 | 说明 |
|---|---|---|
| value_type | 第一个模板参数 (T) | 元素的类型 |
| container_type | 第二个模板参数 (Container) | 底层容器的类型 |
| 引用 | container_type::reference | 通常是 value_type& |
| const_reference | container_type::const_reference | 通常是 const value_type& |
| size_type | 一个无符号整数类型 | 通常与 size_t 相同 |