Namespaces
Variants
Views
Actions

std::reverse_iterator<Iter>::operator*,->

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
Utilities
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
 
(1)
reference operator*() const;
(until C++17)
constexpr reference operator*() const;
(since C++17)
(2)
pointer operator->() const;
(until C++17)
constexpr pointer operator->() const;
(since C++17)
(until C++20)
constexpr pointer operator->() const

    requires (std::is_pointer_v<Iter> ||

              requires (const Iter i) { i.operator->(); });
(since C++20)

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

1) Equivalent to Iter tmp = current; return *--tmp;
2) Equivalent to return std::addressof(operator*());.
(until C++20)
2) Equivalent to return current - 1; if Iter is a pointer type. Otherwise, equivalent to return std::prev(current).operator->();.
(since C++20)

Contents

[edit] Parameters

(none)

[edit] Return value

Reference or pointer to the element previous to current.

[edit] Example

[edit] See also

accesses an element by index
(public member function) [edit]