source:
doc/generic_types/evaluation/cpp-vstack.hpp
@
cf966b5
Last change on this file since cf966b5 was c87cd93, checked in by , 7 years ago | |
---|---|
|
|
File size: 425 bytes |
Rev | Line | |
---|---|---|
[b276be5] | 1 | #pragma once |
2 | #include "object.hpp" | |
3 | ||
4 | class stack { | |
5 | struct node { | |
[79b8dc3] | 6 | ptr<object> value; |
[b276be5] | 7 | node* next; |
8 | ||
[c87cd93] | 9 | node( const object& v, node* n = nullptr ); |
[b276be5] | 10 | }; |
11 | node* head; | |
12 | ||
13 | void copy(const stack& o); | |
14 | public: | |
15 | stack(); | |
16 | stack(const stack& o); | |
17 | stack(stack&& o); | |
18 | ~stack(); | |
19 | stack& operator= (const stack& o); | |
20 | stack& operator= (stack&& o); | |
21 | ||
[a381b46] | 22 | void clear(); |
[b276be5] | 23 | bool empty() const; |
[c87cd93] | 24 | void push(const object& value); |
[79b8dc3] | 25 | ptr<object> pop(); |
[b276be5] | 26 | }; |
Note: See TracBrowser
for help on using the repository browser.