From d823646db3e9f72569717dc656e5b2e4d3ce7709 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 29 Aug 2011 17:49:48 +0200 Subject: 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 --- tests/auto/corelib/tools/qmap/tst_qmap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/corelib/tools/qmap/tst_qmap.cpp') diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index 79b0a931cb..7d0ef7d7e4 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -285,6 +285,8 @@ void tst_QMap::beginEnd() QVERIFY( map.constBegin() == map.constEnd() ); map.insert( "0", "a" ); map.insert( "1", "b" ); + QVERIFY( map.constBegin() == map.cbegin() ); + QVERIFY( map.constEnd() == map.cend() ); // make a copy. const function shouldn't detach StringMap map2 = map; -- cgit v1.2.3