」 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

28
ex02/main.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include "MutantStack.hpp"
#include <iostream>
int main()
{
MutantStack<int> mstack;
mstack.push(5);
mstack.push(17);
std::cout << mstack.top() << std::endl;
mstack.pop();
std::cout << mstack.size() << std::endl;
mstack.push(3);
mstack.push(5);
mstack.push(737);
//[...]
mstack.push(0);
MutantStack<int>::iterator it = mstack.begin();
MutantStack<int>::iterator ite = mstack.end();
++it;
--it;
while (it != ite)
{
std::cout << *it << std::endl;
++it;
}
std::stack<int> s(mstack);
return 0;
}