containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()
authorMarc Mutz <marc.mutz@kdab.com>
Mon, 29 Aug 2011 15:49:48 +0000 (17:49 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sat, 17 Mar 2012 08:10:57 +0000 (09:10 +0100)
commitd823646db3e9f72569717dc656e5b2e4d3ce7709
tree734f7f11b381eb890d406b05f93424e3081795d6
parent7c7e47493edec987569a60e12456de5a2c62a230
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>
21 files changed:
src/corelib/tools/qbytearray.cpp
src/corelib/tools/qbytearray.h
src/corelib/tools/qhash.cpp
src/corelib/tools/qhash.h
src/corelib/tools/qlinkedlist.cpp
src/corelib/tools/qlinkedlist.h
src/corelib/tools/qlist.cpp
src/corelib/tools/qlist.h
src/corelib/tools/qmap.cpp
src/corelib/tools/qmap.h
src/corelib/tools/qset.h
src/corelib/tools/qset.qdoc
src/corelib/tools/qstring.cpp
src/corelib/tools/qstring.h
src/corelib/tools/qvarlengtharray.h
src/corelib/tools/qvarlengtharray.qdoc
src/corelib/tools/qvector.cpp
src/corelib/tools/qvector.h
tests/auto/corelib/tools/qmap/tst_qmap.cpp
tests/auto/corelib/tools/qset/tst_qset.cpp
tests/auto/other/collections/tst_collections.cpp