- Qt 5.15
- Qt Core
- C++ Classes
- iterator
- Qt 5.15.19 Reference Documentation

# Obsolete Members for iterator

The following members of class iterator are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(obsolete)` iterator | operator+(int j) const
`(obsolete)` iterator & | operator+=(int j)
`(obsolete)` iterator | operator-(int j) const
`(obsolete)` iterator & | operator--()
`(obsolete)` iterator | operator--(int)
`(obsolete)` iterator & | operator-=(int j)

## Member Function Documentation

### iterator iterator::operator+(int j) const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

Returns an iterator to the item at j positions forward from this iterator. (If j is negative, the iterator goes backward.)

This operation can be slow for large j values.

See also operator-().

### iterator &iterator::operator+=(int j)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

Advances the iterator by j items. (If j is negative, the iterator goes backward.)

See also operator-=() and operator+().

### iterator iterator::operator-(int j) const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

Returns an iterator to the item at j positions backward from this iterator. (If j is negative, the iterator goes forward.)

This operation can be slow for large j values.

See also operator+().

### iterator &iterator::operator--()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

The prefix -- operator (`--i`) makes the preceding item current and returns an iterator pointing to the new current item.

Calling this function on QHash::begin() leads to undefined results.

See also operator++().

### iterator iterator::operator--(int)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

This is an overloaded function.

The postfix -- operator (`i--`) makes the preceding item current and returns an iterator pointing to the previously current item.

### iterator &iterator::operator-=(int j)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This operator is deprecated in order to align with std::unordered_map functionality.

Makes the iterator go back by j items. (If j is negative, the iterator goes forward.)

See also operator+=() and operator-().