From db04dd427d51aca647d68eb5a688273ee16f2fea Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 May 2008 23:02:05 +0000 Subject: Formatting. svn-id: r31852 --- common/stack.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'common/stack.h') diff --git a/common/stack.h b/common/stack.h index 1d38c7d2ac..876efacc3f 100644 --- a/common/stack.h +++ b/common/stack.h @@ -33,7 +33,7 @@ namespace Common { /** * Extremly simple fixed size stack class. */ -template +template class FixedStack { protected: T _stack[MAX_SIZE]; @@ -47,15 +47,15 @@ public: void clear() { _size = 0; } - void push(const T& x) { + void push(const T &x) { assert(_size < MAX_SIZE); _stack[_size++] = x; } - const T& top() const { + const T &top() const { assert(_size > 0); return _stack[_size - 1]; } - T& top() { + T &top() { assert(_size > 0); return _stack[_size - 1]; } @@ -67,11 +67,11 @@ public: int size() const { return _size; } - T& operator [](int i) { + T &operator[](int i) { assert(0 <= i && i < MAX_SIZE); return _stack[i]; } - const T& operator [](int i) const { + const T &operator[](int i) const { assert(0 <= i && i < MAX_SIZE); return _stack[i]; } @@ -81,7 +81,7 @@ public: /** * Variable size stack class, implemented using our Array class. */ -template +template class Stack { protected: Array _stack; @@ -95,7 +95,7 @@ public: void clear() { _stack.clear(); } - void push(const T& x) { + void push(const T &x) { _stack.push_back(x); } T top() const { @@ -110,7 +110,7 @@ public: int size() const { return _stack.size(); } - T operator [](int i) { + T operator[](int i) { return _stack[i]; } }; -- cgit v1.2.3