]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/stack.h
set eol-style
[wxWidgets.git] / include / wx / stack.h
index e359111c40439985393d21bcfb29e0e51762a5c3..53f5121c2cde1de81690dcca298a17fde305f196 100644 (file)
 #define WX_DECLARE_STACK(obj, cls)\
 class cls : public wxVectorBase\
 {\
-       WX_DECLARE_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_