X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..64b1cea09aac1077469090dc2dac9a139a509833:/include/wx/stack.h?ds=sidebyside diff --git a/include/wx/stack.h b/include/wx/stack.h index 3edda4fc49..835b736a63 100644 --- a/include/wx/stack.h +++ b/include/wx/stack.h @@ -5,7 +5,7 @@ // Modified by: // Created: 30.07.2001 // Copyright: (c) 2001 Lindsay Mathieson -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_STACK_H_ @@ -13,31 +13,28 @@ #include "wx/vector.h" -#define WX_DECLARE_STACK(obj, cls)\ -class cls : public wxVectorBase\ +#define WX_DECLARE_STACK(obj, cls) \ +class cls : public wxVector \ {\ - WX_DECLARE_VECTORBASE(obj, cls);\ public:\ - void push(const obj& o)\ - {\ - bool rc = Alloc(size() + 1);\ - wxASSERT(rc);\ - Append(new obj(o));\ - };\ + void push(const obj& o)\ + {\ + push_back(o); \ + };\ \ - void pop()\ - {\ - RemoveAt(size() - 1);\ - };\ + void pop()\ + {\ + pop_back(); \ + };\ \ - obj& top()\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ - const obj& top() const\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ + obj& top()\ + {\ + return at(size() - 1);\ + };\ + const obj& top() const\ + {\ + return at(size() - 1); \ + };\ } #endif // _WX_STACK_H_