Namespaces
Variants
Views
Actions

std::reverse_iterator::operator*,->

From cppreference.com
< cpp‎ | iterator‎ | reverse iterator
Revision as of 14:52, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dcl ">

<td >
reference operator*() const;
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
pointer operator->() const;
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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

Parameters

(none)

Return value

Reference or pointer to the element previous to current.

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.

Example

See also

Template:cpp/iterator/adaptor/dcl list operator at