JNI: fix declaration of QJniArray(Mutable)Iterator postfix operators

As per the standard at [1], the second parameter has to be int, while
difference_type is jint (which is also int, so no difference in
practice, esp for the already released QJniArrayIterator).

https://eel.is/c++draft/over.oper#over.inc-1.sentence-3

Addresses API review comment.

Change-Id: Idea11f83048b9b65548ec1ac8abc2586c6e61a27
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 291c5ec433131d43921e77f3b6565e89cc0b3420)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2025-01-08 12:15:31 +01:00 committed by Qt Cherry-pick Bot
parent b18c3ecdbd
commit 087db1d000

View File

@ -86,7 +86,7 @@ public:
++that.m_index;
return that;
}
friend QJniArrayIterator operator++(QJniArrayIterator &that, difference_type) noexcept
friend QJniArrayIterator operator++(QJniArrayIterator &that, int) noexcept
{
auto copy = that;
++that;
@ -110,7 +110,7 @@ public:
--that.m_index;
return that;
}
friend QJniArrayIterator operator--(QJniArrayIterator &that, difference_type) noexcept
friend QJniArrayIterator operator--(QJniArrayIterator &that, int) noexcept
{
auto copy = that;
--that;
@ -228,7 +228,7 @@ public:
++that.m_index;
return that;
}
friend QJniArrayMutableIterator operator++(QJniArrayMutableIterator &that, difference_type) noexcept
friend QJniArrayMutableIterator operator++(QJniArrayMutableIterator &that, int) noexcept
{
auto copy = that;
++that;
@ -252,7 +252,7 @@ public:
--that.m_index;
return that;
}
friend QJniArrayMutableIterator operator--(QJniArrayMutableIterator &that, difference_type) noexcept
friend QJniArrayMutableIterator operator--(QJniArrayMutableIterator &that, int) noexcept
{
auto copy = that;
--that;