File indexing completed on 2026-09-14 09:18:50
0001
0002
0003
0004
0005 #ifndef QQUEUE_H
0006 #define QQUEUE_H
0007
0008 #include <QtCore/qlist.h>
0009
0010 QT_BEGIN_NAMESPACE
0011
0012
0013 template <class T>
0014 class QQueue : public QList<T>
0015 {
0016 public:
0017
0018 inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); }
0019 inline void enqueue(const T &t) { QList<T>::append(t); }
0020 inline void enqueue(T &&t) { QList<T>::append(std::move(t)); }
0021 inline T dequeue() { return QList<T>::takeFirst(); }
0022 inline T &head() { return QList<T>::first(); }
0023 inline const T &head() const { return QList<T>::first(); }
0024 };
0025
0026 QT_END_NAMESPACE
0027
0028 #endif