From c21ee7925bfd129f5a715f986ccde554922cce15 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 3 Sep 2007 03:05:50 +0000 Subject: [PATCH] Update wxStack class macro for the new wxVector git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/stack.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/include/wx/stack.h b/include/wx/stack.h index 53f5121c2c..835b736a63 100644 --- a/include/wx/stack.h +++ b/include/wx/stack.h @@ -13,32 +13,27 @@ #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)\ {\ - if ( !Alloc(size() + 1) )\ - {\ - wxFAIL_MSG(_T("failed to extend stack"));\ - }\ - Append(new obj(o));\ + push_back(o); \ };\ \ void pop()\ {\ - RemoveAt(size() - 1);\ + pop_back(); \ };\ \ obj& top()\ {\ - return *(obj *) GetItem(size() - 1);\ + return at(size() - 1);\ };\ const obj& top() const\ {\ - return *(obj *) GetItem(size() - 1);\ + return at(size() - 1); \ };\ } -- 2.47.2