Skip to content

Commit be7b49f

Browse files
Test program for MutantStack
1 parent 69466ca commit be7b49f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

CPP_Module_08/ex02/main.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* main.cpp :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: shovsepy <marvin@42.fr> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2022/02/05 20:12:08 by shovsepy #+# #+# */
9+
/* Updated: 2022/02/05 20:15:27 by shovsepy ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include "MutantStack.hpp"
14+
#include <iostream>
15+
16+
int main()
17+
{
18+
MutantStack<int> mstack;
19+
20+
mstack.push(5);
21+
mstack.push(17);
22+
23+
std::cout << mstack.top() << std::endl;
24+
25+
mstack.pop();
26+
27+
std::cout << mstack.size() << std::endl;
28+
29+
mstack.push(3);
30+
mstack.push(5);
31+
mstack.push(737);
32+
33+
//[...]
34+
35+
mstack.push(0);
36+
37+
MutantStack<int>::iterator it = mstack.begin();
38+
MutantStack<int>::iterator ite = mstack.end();
39+
40+
++it;
41+
--it;
42+
43+
while (it != ite)
44+
{
45+
std::cout << *it << std::endl;
46+
++it;
47+
}
48+
49+
std::stack<int> s(mstack);
50+
return (0);
51+
}

0 commit comments

Comments
 (0)