Adapter is used to convert a existing interface into another interface, which could be use by the new system.
template <typename T>
class stack
{
public:
void push(const T& _value)
{
m_vectorT.push_back(_value);
}
void pop()
{
m_vectorT.pop_back();
}
T& top()
{
return m_vectorT.back();
}
private:
std::vector<T> m_vectorT;
};
Adapt the vector make it to behave like a stack.