Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:18:50

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
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     // compiler-generated special member functions are fine!
0018     inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
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 // QQUEUE_H