47 lines
816 B
C++
47 lines
816 B
C++
#pragma once
|
|
|
|
#include <stack>
|
|
#include <string>
|
|
#include <iostream>
|
|
|
|
template <typename T> class MutantStack : public std::stack<T> {
|
|
public:
|
|
MutantStack(void) {}
|
|
MutantStack(const MutantStack &cpy) : std::stack<T>(cpy) {}
|
|
~MutantStack(void) {}
|
|
|
|
MutantStack &operator=(const MutantStack &cpy)
|
|
{
|
|
if (this != &cpy)
|
|
{
|
|
std::stack<T>::operator=(cpy);
|
|
}
|
|
return *this;
|
|
}
|
|
|
|
typedef typename std::stack<T>::container_type::iterator iterator;
|
|
|
|
iterator begin(void)
|
|
{
|
|
return std::stack<T>::c.begin();
|
|
}
|
|
iterator end(void)
|
|
{
|
|
return std::stack<T>::c.end();
|
|
}
|
|
|
|
typedef typename std::stack<T>::container_type::const_iterator const_iterator;
|
|
|
|
const_iterator begin(void) const
|
|
{
|
|
return std::stack<T>::c.begin();
|
|
}
|
|
const_iterator end(void) const
|
|
{
|
|
return std::stack<T>::c.end();
|
|
}
|
|
|
|
private:
|
|
};
|
|
|