File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments