templatee<class T, class Sequence =deque<T> >
class queue
{
friend bool operator==_STL_NULL_TMPL_ARGS(const queue&,const queue&);
friend bool operator< _STL_NULL_TMPL_ARGS(const queue&,const queue&);
public:
typedef typename Sequence::value_type value_type;
typedef typename Sequence::size_type size_type;
typedef typename Sequence::referece referece;
typedef typename Sequence::const_referece const_referece;
protected:
Sequeue c;
public:
bool empty() const {return c.empty;}
size_type size() const {return c.size();}
reference top() {return c.back();}
const_reference top() cosnt {return c.back;}
void push(const value_type & x) {c.push_back(x);}
void pop() {c.pop_back();}
};
---------------------------------------------------
template <class T, class Sequence>
bool operator==(const stack<T,Sequence>& x,const stack<T,Sequece> &y)
{
return x.c=y.c;
}
template <class T, class Sequence>
bool operator<(const stack<T,Sequence>& x,const stack<T,Sequece> &y)
{
return x.c<y.c;
}
list作为queue的底层容器
queue<int ,list<int>> isQueue;