diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-05-24 08:35:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-19 19:54:44 +0200 |
commit | ed116aa3b39c54ce78468f50f10c2d4cc7b02816 (patch) | |
tree | b6834f5cfaec12868a83a6baa1b767ff864eaec6 /src/corelib/tools/qvarlengtharray.h | |
parent | 77fc6d30f1bd4bdd8894dd98e12373211241a091 (diff) |
QVarLengthArray: provide STL-compatible member function names
This allows, among other things, to use QVarLengthArray as the target of
a std::back_insert_iterator.
Change-Id: I507f612a23da854bf865780aa0a7e6312f4a896b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index ba24541d2d..9d52da8250 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -172,6 +172,15 @@ public: iterator erase(const_iterator begin, const_iterator end); inline iterator erase(const_iterator pos) { return erase(pos, pos+1); } + // STL compatibility: + inline bool empty() const { return isEmpty(); } + inline void push_back(const T &t) { append(t); } + inline void pop_back() { removeLast(); } + inline T &front() { return first(); } + inline const T &front() const { return first(); } + inline T &back() { return last(); } + inline const T &back() const { return last(); } + private: friend class QPodList<T, Prealloc>; void realloc(int size, int alloc); |