summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmap.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2011-08-29 17:49:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-17 09:10:57 +0100
commitd823646db3e9f72569717dc656e5b2e4d3ce7709 (patch)
tree734f7f11b381eb890d406b05f93424e3081795d6 /src/corelib/tools/qmap.cpp
parent7c7e47493edec987569a60e12456de5a2c62a230 (diff)
containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()
C++11 adds cbegin()/cend() functions for the same reason Qt has constBegin()/constEnd(). This patch adds these functions to the Qt containers with the same implementation as constBegin()/constEnd(). It also fixes the return types in the documentation of existing constFind() functions (documentation only). C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have). In particular, it doesn't add cfind(), so I didn't supply these, even though Qt comes with constFind(). This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365. Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qmap.cpp')
-rw-r--r--src/corelib/tools/qmap.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 103d074941..e0b53fc64e 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -682,6 +682,15 @@ void QMapData::dump()
\overload
*/
+/*! \fn QMap::const_iterator QMap::cbegin() const
+ \since 5.0
+
+ Returns a const \l{STL-style iterator} pointing to the first item
+ in the map.
+
+ \sa begin(), cend()
+*/
+
/*! \fn QMap::const_iterator QMap::constBegin() const
Returns a const \l{STL-style iterator} pointing to the first item
@@ -703,6 +712,15 @@ void QMapData::dump()
\overload
*/
+/*! \fn QMap::const_iterator QMap::cend() const
+ \since 5.0
+
+ Returns a const \l{STL-style iterator} pointing to the imaginary
+ item after the last item in the map.
+
+ \sa cbegin(), end()
+*/
+
/*! \fn QMap::const_iterator QMap::constEnd() const
Returns a const \l{STL-style iterator} pointing to the imaginary
@@ -744,7 +762,7 @@ void QMapData::dump()
\overload
*/
-/*! \fn QMap::iterator QMap::constFind(const Key &key) const
+/*! \fn QMap::const_iterator QMap::constFind(const Key &key) const
\since 4.1
Returns an const iterator pointing to the item with key \a key in the