msdn上的解析:
value_type& front( );
const value_type& front( ) const;
Returns a reference to the first element at the front of the queue.
请看下面示例代码
queue<int> intqueue;
intqueue.push(1);
intqueue.push(2);
int head = intqueue.front();//int&可以隐式转换为int?
intqueue.pop();//将对头元素弹出队列
cout << head << endl;//输出1,front应该返回的是"引用",但pop之后,为什么head的输出还有效(引用还有效?)?