cpp/CPP08/ex02/MutantStack.hpp
2024-12-04 17:29:31 +01:00

24 lines
565 B
C++

#pragma once
#include <iostream>
#include <stack>
#include <deque>
#include <algorithm>
template<typename T, class Container = std::deque<T> >
class MutantStack : public std::stack<T, Container> {
public:
MutantStack() {};
MutantStack(const MutantStack &mut) { *this = mut; }
~MutantStack() {};
MutantStack &operator=(const MutantStack &mut) {
std::stack<T, Container>::operator=(mut);
return *this;
}
typedef typename Container::iterator iterator;
iterator begin() { return this->c.begin(); }
iterator end() { return this->c.end(); }
};