From 84770d6375dab57d07a2d3028182a1d920bb58c1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 17 Apr 2015 09:13:47 +0200 Subject: [PATCH] QVector: mark const variants of begin()/end() nothrow Change-Id: Id08e692bbfedb43911ffbbfdf09aa6b68a4aa1f9 Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 7bcd13e7d0..2adb047ed9 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -192,29 +192,29 @@ public: typedef std::reverse_iterator const_reverse_iterator; #if !defined(QT_STRICT_ITERATORS) || defined(Q_QDOC) inline iterator begin() { detach(); return d->begin(); } - inline const_iterator begin() const { return d->constBegin(); } - inline const_iterator cbegin() const { return d->constBegin(); } - inline const_iterator constBegin() const { return d->constBegin(); } + inline const_iterator begin() const Q_DECL_NOTHROW { return d->constBegin(); } + inline const_iterator cbegin() const Q_DECL_NOTHROW { return d->constBegin(); } + inline const_iterator constBegin() const Q_DECL_NOTHROW { return d->constBegin(); } inline iterator end() { detach(); return d->end(); } - inline const_iterator end() const { return d->constEnd(); } - inline const_iterator cend() const { return d->constEnd(); } - inline const_iterator constEnd() const { return d->constEnd(); } + inline const_iterator end() const Q_DECL_NOTHROW { return d->constEnd(); } + inline const_iterator cend() const Q_DECL_NOTHROW { return d->constEnd(); } + inline const_iterator constEnd() const Q_DECL_NOTHROW { return d->constEnd(); } #else inline iterator begin(iterator = iterator()) { detach(); return d->begin(); } - inline const_iterator begin(const_iterator = const_iterator()) const { return d->constBegin(); } - inline const_iterator cbegin(const_iterator = const_iterator()) const { return d->constBegin(); } - inline const_iterator constBegin(const_iterator = const_iterator()) const { return d->constBegin(); } + inline const_iterator begin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); } + inline const_iterator cbegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); } + inline const_iterator constBegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); } inline iterator end(iterator = iterator()) { detach(); return d->end(); } - inline const_iterator end(const_iterator = const_iterator()) const { return d->constEnd(); } - inline const_iterator cend(const_iterator = const_iterator()) const { return d->constEnd(); } - inline const_iterator constEnd(const_iterator = const_iterator()) const { return d->constEnd(); } + inline const_iterator end(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); } + inline const_iterator cend(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); } + inline const_iterator constEnd(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); } #endif reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } - const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); } - const_reverse_iterator crend() const { return const_reverse_iterator(begin()); } + const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); } + const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); } + const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); } + const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); } iterator insert(iterator before, int n, const T &x); inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } iterator erase(iterator begin, iterator end);