X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c648a82a574a5fad06fdbdc61c4e10e340438c2..333e57d578e9e0fb6555452b5a53698ffd85ee69:/include/wx/stack.h?ds=inline diff --git a/include/wx/stack.h b/include/wx/stack.h index 8cd78bf271..53f5121c2c 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: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_STACK_H_ @@ -13,31 +13,33 @@ #include "wx/vector.h" -#define WX_DECLARE_STL_STACK(obj, cls)\ +#define WX_DECLARE_STACK(obj, cls)\ class cls : public wxVectorBase\ {\ - WX_DECLARE_STL_VECTORBASE(obj, cls);\ + 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)\ + {\ + if ( !Alloc(size() + 1) )\ + {\ + wxFAIL_MSG(_T("failed to extend stack"));\ + }\ + Append(new obj(o));\ + };\ \ - void pop()\ - {\ - RemoveAt(size() - 1);\ - };\ + void pop()\ + {\ + RemoveAt(size() - 1);\ + };\ \ - obj& top()\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ - const obj& top() const\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ + obj& top()\ + {\ + return *(obj *) GetItem(size() - 1);\ + };\ + const obj& top() const\ + {\ + return *(obj *) GetItem(size() - 1);\ + };\ } #endif // _WX_STACK_H_