post-increment operators must not use the int argument (it is zero)

This commit is contained in:
Matthias Koefferlein 2024-03-30 16:48:01 +01:00
parent 1868dcc104
commit 7e8ce51da2
1 changed files with 4 additions and 8 deletions

View File

@ -116,12 +116,10 @@ public:
/**
* @brief Post-decrement
*/
weak_or_shared_collection_iterator<T, Holder, Shared> operator-- (int n)
weak_or_shared_collection_iterator<T, Holder, Shared> operator-- (int)
{
weak_or_shared_collection_iterator<T, Holder, Shared> ret = *this;
while (n-- > 0) {
operator-- ();
}
operator-- ();
return ret;
}
@ -138,12 +136,10 @@ public:
/**
* @brief Post-increment
*/
weak_or_shared_collection_iterator<T, Holder, Shared> operator++ (int n)
weak_or_shared_collection_iterator<T, Holder, Shared> operator++ (int)
{
weak_or_shared_collection_iterator<T, Holder, Shared> ret = *this;
while (n-- > 0) {
operator++ ();
}
operator++ ();
return ret;
}