QDirListing: const_iterator: mark the relational operators noexcept

Pointed out in code review.

Change-Id: I7754f510f4cca5e9fc695a26caaf124133602f32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9a8768c7159869aa216b7328c69f4b80f26f467e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2024-07-04 23:42:53 +03:00 committed by Qt Cherry-pick Bot
parent e6fc32a9c5
commit e37832cc37

View File

@ -108,12 +108,12 @@ public:
pointer operator->() const { return &dirEntry; } pointer operator->() const { return &dirEntry; }
Q_CORE_EXPORT const_iterator &operator++(); Q_CORE_EXPORT const_iterator &operator++();
const_iterator operator++(int) { auto tmp = *this; operator++(); return tmp; }; 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 // This is only used for the sentinel end iterator
return lhs.dirListPtr == nullptr && rhs.dirListPtr == nullptr; 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); } { return !(lhs == rhs); }
}; };