From e37832cc379b4989ebaa9019982f564511a88421 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 4 Jul 2024 23:42:53 +0300 Subject: [PATCH] QDirListing: const_iterator: mark the relational operators noexcept Pointed out in code review. Change-Id: I7754f510f4cca5e9fc695a26caaf124133602f32 Reviewed-by: Ivan Solovev (cherry picked from commit 9a8768c7159869aa216b7328c69f4b80f26f467e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qdirlisting.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdirlisting.h b/src/corelib/io/qdirlisting.h index 1612539e55e..21e12b2898d 100644 --- a/src/corelib/io/qdirlisting.h +++ b/src/corelib/io/qdirlisting.h @@ -108,12 +108,12 @@ public: pointer operator->() const { return &dirEntry; } Q_CORE_EXPORT const_iterator &operator++(); const_iterator operator++(int) { auto tmp = *this; operator++(); return tmp; }; - friend bool operator==(const const_iterator &lhs, const const_iterator &rhs) + friend bool operator==(const const_iterator &lhs, const const_iterator &rhs) noexcept { // This is only used for the sentinel end iterator return lhs.dirListPtr == nullptr && rhs.dirListPtr == nullptr; } - friend bool operator!=(const const_iterator &lhs, const const_iterator &rhs) + friend bool operator!=(const const_iterator &lhs, const const_iterator &rhs) noexcept { return !(lhs == rhs); } };