summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorchatty1992-12-22 17:38:12 +0000
committerchatty1992-12-22 17:38:12 +0000
commit05ab076e1c2a9ca16472f9a6b47b8d22914b3783 (patch)
treeb446dffcf39a9d3e14049c4c62faa72b217ae8ea /utils
parent0e857e15d26953bc92f4f368b3320d4e80447d06 (diff)
downloadivy-league-05ab076e1c2a9ca16472f9a6b47b8d22914b3783.zip
ivy-league-05ab076e1c2a9ca16472f9a6b47b8d22914b3783.tar.gz
ivy-league-05ab076e1c2a9ca16472f9a6b47b8d22914b3783.tar.bz2
ivy-league-05ab076e1c2a9ca16472f9a6b47b8d22914b3783.tar.xz
Added generic stacks
Diffstat (limited to 'utils')
-rw-r--r--utils/List.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/List.h b/utils/List.h
index 9e61c9e..81ed6ba 100644
--- a/utils/List.h
+++ b/utils/List.h
@@ -166,6 +166,16 @@ inline CcuStackItem* Pop () { return RemoveFirst (); }
inline CcuStackItem* Top () { return First (); }
};
+#ifndef CPLUS_BUG19
+template <class ITEM> class CcuStackOf : public CcuStack {
+public:
+inline void Push (ITEM* p) { CcuStack::Push (p); }
+inline ITEM* Pop () { return (ITEM*) CcuStack::Pop (); }
+inline ITEM* Top () { return (ITEM*) CcuStack::Top (); }
+inline operator const CcuListOf <ITEM>& () { return *(CcuListOf <ITEM>*) this; }
+};
+#endif /* CPLUS_BUG19 */
+
typedef CcuListItem CcuQueueItem;
/* CPLUS_BUG10 */
@@ -184,7 +194,7 @@ template <class ITEM> class CcuQueueOf : public CcuQueue {
public:
inline void Put (ITEM* p) { CcuQueue::Put (p); }
inline ITEM* Get () { return (ITEM*) CcuQueue::Get (); }
-inline operator const CcuListOf <ITEM>& () { return *this; }
+inline operator const CcuListOf <ITEM>& () { return *(CcuListOf <ITEM>*) this; }
};
#endif /* CPLUS_BUG19 */