##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::reverse_iterator::operator*,->

From cppreference.com
< cpp‎ | iterator‎ | reverse iterator

reference operator*() const; | (1) |
pointer operator->() const; | (2) |

Returns a reference or pointer to the element previous to `current`.

1) Equivalent to d_tmp = current; --d_tmp; return *d_tmp;;
2) Equivalent to &(operator*()).

### [edit] Parameters

(none)

### [edit] Return value

Reference or pointer to the element previous to `current`.

### [edit] Notes

The iterator object contains an auxiliary member variable `d_tmp`, not a temporary variable, to avoid returning a reference that persists beyond the lifetime of its associated iterator.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

operator[] | obtains rvalue reference to indexed element (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/iterator/reverse_iterator/operator*&oldid=58008"
Category:

- Todo no example