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>
bb10
Thiago Macieira 2013-07-08 16:04:54 -07:00 committed by The Qt Project
parent 536b25b375
commit 2c285b893c
2 changed files with 33 additions and 3 deletions

View File

@ -819,18 +819,44 @@ const QString::Null QString::null = { };
\sa QString::const_iterator
*/
/*!
\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

View File

@ -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); }