summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-07-08 16:04:54 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-30 02:57:54 +0200
commit2c285b893caae37f132de75bcc77bf5471107689 (patch)
tree397aa4e13d7cb144ddf3d0be8679c988173f1ddc
parent536b25b3759d46724ec5957868206c1408233d1b (diff)
Add a few more typedefs to QString, for STL compatibility
Task-number: QTBUG-22890 Change-Id: I457be6367e577dee30532383d10c519b2f2617b3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
-rw-r--r--src/corelib/tools/qstring.cpp32
-rw-r--r--src/corelib/tools/qstring.h4
2 files changed, 33 insertions, 3 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 37d28b0904..36bd61098a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -820,17 +820,43 @@ const QString::Null QString::null = { };
*/
/*!
+ \typedef QString::size_type
+
+ The QString::size_type typedef provides an STL-style type for sizes (int).
+*/
+
+/*!
+ \typedef QString::difference_type
+
+ The QString::size_type typedef provides an STL-style type for difference between pointers.
+*/
+
+/*!
\typedef QString::const_reference
The QString::const_reference typedef provides an STL-style
- const reference for QString.
+ const reference for a QString element (QChar).
*/
/*!
\typedef QString::reference
- The QString::const_reference typedef provides an STL-style
- reference for QString.
+ The QString::reference typedef provides an STL-style
+ reference for a QString element (QChar).
*/
+
+/*!
+ \typedef QString::const_pointer
+
+ The QString::const_pointer typedef provides an STL-style
+ const pointer to a QString element (QChar).
+*/
+/*!
+ \typedef QString::pointer
+
+ The QString::const_pointer typedef provides an STL-style
+ pointer to a QString element (QChar).
+*/
+
/*!
\typedef QString::value_type
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index d8aaa929dc..7010a954b4 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -657,8 +657,12 @@ public:
const_iterator constEnd() const;
// STL compatibility
+ typedef int size_type;
+ typedef qptrdiff difference_type;
typedef const QChar & const_reference;
typedef QChar & reference;
+ typedef QChar *pointer;
+ typedef const QChar *const_pointer;
typedef QChar value_type;
inline void push_back(QChar c) { append(c); }
inline void push_back(const QString &s) { append(s); }