# operator-(std::move_iterator)

> C++ Atlas: `cppatlas.com/w/cpp/iterator/move_iterator/operator-` | Source: https://en.cppreference.com/w/cpp/iterator/move_iterator/operator- | Domain: Iterator | Standards: C++11, C++17

Returns the distance between two iterator adaptors.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <iterator>

template< class Iter1, class Iter2 >
auto operator-( const move_iterator<Iter1>& lhs,
                const move_iterator<Iter2>& rhs )
    -> decltype(lhs.base() - rhs.base()); // (since C++11) (constexpr since C++17)
```

Returns the distance between two iterator adaptors.

### Parameters

- `lhs, rhs` - iterator adaptors to compute the difference of

### Return value

`lhs.base() - rhs.base()`

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`operator++`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith) (C++11), [`operator++(int)`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator+=`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator+`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator--`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator--(int)`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator-=`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith), [`operator-`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator_arith): advances or decrements the iterator (public member function)
- [`operator+`](https://en.cppreference.com/w/cpp/iterator/move_iterator/operator+) (C++11): advances the iterator (function template)

---
Attribution: content from https://en.cppreference.com/w/cpp/iterator/move_iterator/operator- (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.