#include <iostream>
using namespace std;
//
class CDeque
{
public:
void push_front() { cout<<"CDeque push_front"<<endl; }
void push_back() { cout<<"CDeque push_back"<<endl; }
void pop_front() { cout<<"CDeque pop_front"<<endl; }
void pop_back() { cout<<"CDeque pop_back"<<endl; }
};
struct ISequence
{
public:
virtual void push() = 0;
virtual void pop() = 0;
};
class CStack : public ISequence
{
public:
virtual void push() { m_deque.push_back(); }
virtual void pop() { m_deque.pop_back(); }
private:
CDeque m_deque;
};
class CQueue : public ISequence
{
public:
virtual void push() { m_deque.push_back(); }
virtual void pop() { m_deque.pop_front(); }
private:
CDeque m_deque;
};
//
void main()
{
CStack stack;
stack.push();
stack.pop();
CQueue queue;
queue.push();
queue.pop();
}