STL容器适配器-队列(queue)
2017-11-08 08:55
295 查看
/* * 对列先入先出,队列永远子头部出,尾部入 */ template<class T,class Cont = deque<T> > class queue { public: //类型定义 typedef Cont::allocator_type allocator_type; typedef Cont::value_type value_type; typedef Cont::size_type size_type; explicit queue(const allocator_type& al = allocator_type()) const; //若队列为空返回false bool empty() const; //返回队列大小 size_type size() const; allocator_type get_allocator() const; //返回头元素的引用 value_type& top(); const value_type& top() const; //入队 void push(const value_type& x); //出队 void pop(); protected: Cont c; };
相关文章推荐
- 【双端队列】【栈】【队列】STL之deque、stack、queue、容器适配器
- 【优先队列】【堆】STL之priority_queue、make_heap()、push_heap()、pop_heap()、容器适配器
- stl 顺序容器适配器之stack, priority_queue, queue用法
- STL(十九)queue队列容器
- STL(二十)priority_queue优先队列容器
- STL之容器适配器queue的实现框架
- STL之容器适配器:stack,queue , priority_queue
- STL序列式容器之优先队列——priority_queue
- [C++ 从入门到放弃-09]C++STL之queue队列容器
- STL之容器适配器priority_queue的实现框架
- C++ STL 有关容器部分 priority_queue 优先级队列的基本操作以及认识案例
- STL之容器适配器queue的实现框架
- stl之queue队列容器
- 从零开始学C++之STL(十一):容器适配器(stack、 queue 、priority_queue)源码浅析与使用示例
- C++的STL容器之容器适配器:stack、queue、priority_queue
- STL常用容器总结——queue单向队列
- stl之适配器容器——stack, queue, priority_queue
- STL学习——STL中的序列式容器及适配器总结(vector、list、deque、stack、queue)
- STL序列式容器之队列——queue
- 【语法】STL容器适配器:队列,优先队列,堆,栈