File indexing completed on 2025-07-11 08:41:15
0001
0002
0003
0004 #ifndef QSTACK_H
0005 #define QSTACK_H
0006
0007 #include <QtCore/qlist.h>
0008
0009 QT_BEGIN_NAMESPACE
0010
0011 template<class T>
0012 class QStack : public QList<T>
0013 {
0014 public:
0015
0016 void swap(QStack<T> &other) noexcept { QList<T>::swap(other); }
0017 void push(const T &t) { QList<T>::append(t); }
0018 T pop() { return QList<T>::takeLast(); }
0019 T &top() { return QList<T>::last(); }
0020 const T &top() const { return QList<T>::last(); }
0021 };
0022
0023 QT_END_NAMESPACE
0024
0025 #endif