diff options
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r-- | src/corelib/tools/qvector.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index f6fe316a15..e2c28e4060 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -140,6 +140,8 @@ public: void remove(int i, int n); inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(d->begin()); } inline void removeLast() { Q_ASSERT(!isEmpty()); erase(d->end() - 1); } + inline T takeFirst() { Q_ASSERT(!isEmpty()); T r = first(); removeFirst(); return r; } + inline T takeLast() { Q_ASSERT(!isEmpty()); T r = last(); removeLast(); return r; } QVector<T> &fill(const T &t, int size = -1); |