Line 0
Link Here
|
|
|
1 |
--- mixkit/src/MxStack.h.orig |
2 |
+++ mixkit/src/MxStack.h |
3 |
@@ -26,14 +26,14 @@ |
4 |
MxStack(const T& val, unsigned int n) : MxDynBlock<T>(n) |
5 |
{ push(val); } |
6 |
|
7 |
- T& top() { return last(); } |
8 |
- const T& top() const { return last(); } |
9 |
+ T& top() { return this->last(); } |
10 |
+ const T& top() const { return this->last(); } |
11 |
|
12 |
- bool is_empty() { return length()==0; } |
13 |
+ bool is_empty() { return this->length()==0; } |
14 |
|
15 |
- T& pop() { return drop(); } |
16 |
+ T& pop() { return this->drop(); } |
17 |
|
18 |
- void push(const T& val) { add(val); } |
19 |
+ void push(const T& val) { this->add(val); } |
20 |
// |
21 |
// NOTE: In this code, it is *crucial* that we do the add() and |
22 |
// assignment in separate steps. The obvious alternative |
23 |
@@ -41,7 +41,7 @@ |
24 |
// broken! The top() will grab a pointer into the block, |
25 |
// but the add() may reallocate the block before doing the |
26 |
// assignment. Thus, the pointer will become invalid. |
27 |
- void push() { add(); top() = (*this)[length()-2]; } |
28 |
+ void push() { this->add(); top() = (*this)[this->length()-2]; } |
29 |
}; |
30 |
|
31 |
// MXSTACK_INCLUDED |