summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qbytearray.h')
-rw-r--r--src/corelib/tools/qbytearray.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 7388c4eee5..f0032227e8 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -43,6 +43,7 @@
#include <stdarg.h>
#include <string>
+#include <iterator>
#ifdef truncate
#error qbytearray.h must be included before any header file that defines truncate
@@ -390,14 +391,22 @@ public:
typedef const char *const_iterator;
typedef iterator Iterator;
typedef const_iterator ConstIterator;
- iterator begin();
- const_iterator begin() const;
- const_iterator cbegin() const;
- const_iterator constBegin() const;
- iterator end();
- const_iterator end() const;
- const_iterator cend() const;
- const_iterator constEnd() const;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ inline iterator begin();
+ inline const_iterator begin() const;
+ inline const_iterator cbegin() const;
+ inline const_iterator constBegin() const;
+ inline iterator end();
+ inline const_iterator end() const;
+ inline const_iterator cend() const;
+ inline const_iterator constEnd() const;
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
// stl compatibility
typedef int size_type;