码迷,mamicode.com
首页 > 其他好文 > 详细

queue使用内联函数实现stl功能

时间:2017-10-30 21:52:47      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:logs   pop   stl   blog   lin   class   highlight   inline   oid   

struct queue
{
	int head,tail;
	int num[100000];
	queue()	{head=0;	tail=0;}
	inline void push(int o)	{num[tail++]=o;}
	inline int pop()	{return num[head++];}
	inline bool	empty()	{return head>=tail;}
};//必须加入;
int temp=q.pop();
q.push(e[i].y);
!q.empty();

  

queue使用内联函数实现stl功能

标签:logs   pop   stl   blog   lin   class   highlight   inline   oid   

原文地址:http://www.cnblogs.com/Murs/p/7757649.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!