Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qstack.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 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 
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     // compiler-generated special member functions are fine!
0016     void swap(QStack<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QStack swaps
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 // QSTACK_H