」 feat: ex02...

This commit is contained in:
y-syo
2025-08-27 06:13:06 +02:00
parent 98041eb662
commit 84819b741f
5 changed files with 136 additions and 0 deletions

46
ex02/MutantStack.hpp Normal file
View File

@@ -0,0 +1,46 @@
#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:
};