| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* MutantStack.hpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2026/01/14 17:17:11 by bchanot #+# #+# */
- /* Updated: 2026/01/14 19:17:32 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #ifndef MUTANTSTACK_HPP
- # define MUTANTSTACK_HPP
- # include <iostream>
- # include <string>
- #include <deque>
- #include <stack>
- #include <iterator>
- template < typename T, typename Container = std::deque<T> >
- class MutantStack : public std::stack<T, Container>
- {
- public:
- MutantStack() : MutantStack<T, Container>::stack() {};
- MutantStack( MutantStack const & src ) : MutantStack<T, Container>::stack(src) {};
- virtual ~MutantStack() {};
- MutantStack<T, Container> &operator=( MutantStack const & rhs ) {
- if (this != &rhs)
- this->MutantStack<T, Container>::stack::operator=(rhs);
- return *this;
- }
- typedef typename Container::iterator iterator;
- typedef typename Container::reverse_iterator reverse_iterator;
- typedef typename Container::const_iterator const_iterator;
- typedef typename Container::const_reverse_iterator const_reverse_iterator;
- iterator begin() { return this->c.begin(); };
- const_iterator begin() const { return this->c.begin(); };
- iterator end() { return this->c.end(); };
- const_iterator end() const { return this->c.end(); };
- reverse_iterator rbegin() { return this->c.rbegin(); };
- const_reverse_iterator rbegin() const { return this->c.rbegin(); };
- reverse_iterator rend() { return this->c.rend(); };
- const_reverse_iterator rend() const { return this->c.rend(); };
- };
- #endif /* ***************************************************** MUTANTSTACK_H */
|