Library Version 11.2.5.3

operator-
Prev | Chapter 13. Db_vector_iterator | Next

## operator-

### Function Details

    self operator-(difference_type n) const

Iterator movement operator.

Return another iterator by moving this iterator forward by n elements.

#### Parameters

##### n

The amount and direction of movement. If negative, will move backward by |n| element.

#### Return Value

The new iterator at new position.

#### See Also

db_vector_base_iterator::operator-(difference_type n) const

    difference_type operator-(const self &itr) const

Iterator distance operator.

Return the index difference of this iterator and itr, so if this iterator sits on an element with a smaller index, this call will return a negative number.

#### Parameters

##### itr

The other iterator to substract. itr can be the invalid iterator after last element or before first element, their index will be regarded as last element's index + 1 and -1 respectively.

#### Return Value

The index difference.

#### See Also

db_vector_base_iterator::operator-(const self& itr) const

### Group: Iterator movement operators.

These functions have identical behaviors and semantics as those of db_vector_base_iterator , so please refer to equivalent in that class.

### Class

db_vector_iterator

Prev | Up | Next
operator+= | Home | operator-=