Namespaces
Variants
Views
Actions

std::{{{1}}}::operator*,->

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
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*()).

Contents

[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

[edit] See also

accesses an element by index
(public member function of std::{{{1}}}) [edit]