📄 birevers.htm
字号:
<html>
<head>
<title>reverse_iterator</title>
<head>
<body bgcolor="#FFFFFF">
<a name="here"></a>
<img src="itbiban.gif">
<pre>
<font size=5>Class Name</font> reverse_iterator
<font size=5>Header File</font> <iterator>
<font size=5>Classification</font> abstract data type
</pre>
<a href="birevers.htm#crd">Class Relationship Diagram</a><br>
<br>
<a href="birevers.htm#class-descrip">Class Description</a>
<h1>Member Classes</h1>
<a href="birevers.htm#iterator">Iterator current</a>
<h1>Methods</h1>
<pre>
<a href="birevers.htm#base">Iterator base() const;</a>
<a href="birevers.htm#reverse1">reverse_iterator();</a>
<a href="birevers.htm#reverse2">explicit reverse_iterator(Iterator x);</a>
</pre>
<h1>Operators</h1>
<pre>
<a href="birevers.htm#operator*">Reference operator*() const;</a>
<a href="birevers.htm#operator++1">reverse_operator& operator++();</a>
<a href="birevers.htm#operator++2">reverse_operator& operator++(int);</a>
<a href="birevers.htm#operator--1">reverse_operator& operator--();</a>
<a href="birevers.htm#operator--2">reverse_operator operator--(int);</a>
</pre>
<hr>
<a name="class-descrip"><h3>Class Description</h3></a>
<p>
This <a href="defines.htm#reverse">reverse iterator</a> is an adaptation of a <a href="defines.htm#bidirectional">bidirectional iterator</a>. It can
traverse through a container in the same manner as a <a href="defines.htm#bidirectional">bidirectional iterator</a>
but in the reverse direction. Because the reverse iterator traverses in the
reverse order, iterator that points to the start of the container
(rbegin()) actually points to one element after the last element in the
container. In order to avoid this type of violation, the dereference
operator decrements that iterator by 1 or current -1. Thus the mapping of
this type of iteration with the original sequence with bidirectional
iterator i is: &*(reverse_iterator(i)) == &*(i - 1). The incrementation,
++, and decrementation, --, operators perform opposite operations.
The incrementation operator decrements the current
iterator and the decrementation operator increments the current iterator.
</p>
<hr>
<a name="iterator"><h3>Iterator current</h3></a>
<p>
The <a href="defines.htm#bidirectional">bidirectional iterator</a> which points into the container. This iterator is
used to determine the current iterator in reverse order.
</p>
<hr>
<pre>
<a name="reverse1">
Method reverse_iterator()</a>
Access Public
Classification Constructor
Syntax reverse_iterator();
Parameters None
Returns None
</pre>
<h3>Description</h3>
<p>
This constructor constructs a reverse_iterator object.
</p>
<hr>
<pre>
<a name="reverse2">
Method reverse_iterator()</a>
Access Public
Classification Constructor
Syntax explicit reverse_iterator(Iterator x);
Paramters <em>x</em> is the bidirectional iterator which points into
the container.
Returns None
</pre>
<h3>Description</h3>
<p>
This constructor constructs a reverse_iterator object and initializes
Iterator <em>current</em> with <em>x</em>.
</p>
<hr>
<pre>
<a name="operator*">
Method operator*()</a>
Access Public
Classification Accessor
Syntax reference operator*() const;
Parameters None
Returns This operator returns a reference to the iterator.
</pre>
<h3>Description</h3>
<p>
The dereference operator of a const object makes a copy of Iterator <em>current</em>,
decrements the copy and returns a reference to the copy.
</p>
<hr>
<pre>
<a name="operator++1">
Method operator++()</a>
Access Public
Classification Accessor
Syntax reverse_iterator& operator++();
Parameters None
Returns This operator returns a pointer to the current object.
</pre>
<h3>Description</h3>
<p>
The pre-incrementation operator decrements Iterator <em>current</em>
(--current) and then returns *this.
</p>
<hr>
<pre>
<a name="operator++2">
Method operator++()</a>
Access Public
Classification Accessor
Syntax reverse_iterator& operator++(int x);
Parameter <em>x</em> is a dummy argument to distinguish between the
postfix and prefix incrementation that is never
used.
Returns This operator returns a pointer to the current object.
</pre>
<h3>Description</h3>
<p>
The postfix incrementation operator makes a copy of *this, decrements
Iterator <em>current</em> (--current) and then returns the copy of *this.
</p>
<hr>
<pre>
<a name="operator--1">
Method operator--()</a>
Access Public
Classification Accessor
Syntax reverse_iterator& operator--();
Parameters None
Returns This operator returns a pointer to the current object.
</pre>
<h3>Description</h3>
<p>
The pre-decrementation operator increments Iterator <em>current</em>
(++current) and then returns *this.
</p>
<hr>
<pre>
<a name="operator--2">
Method operator--()</a>
Access Public
Classification Accessor
Syntax reverse_iterator& operator--(int x);
Parameters <em>x</em> is a dummy argument to distinguish between the
postfix and prefix incrementation that is never used.
Returns This operator returns a pointer to the current object.
</pre>
<h3>Description</h3>
<p>
The postfix decrementation operator makes a copy of *this, increments
Iterator <em>current</em> (++current) and then returns the copy of *this.
</p>
<hr>
<pre>
<a name="base">
Method base()const</a>
Access Public
Classification Accessor
Syntax Iterator base()const;
Parameters None
Returns This method returns Iterator current.
</pre>
<h3>Description</h3>
<p>
The base() method returns Iterator <em>current</em>.
</p>
<hr>
<a name="crd"><h2>The Class Relationship Diagram for reverse_iterator</h2></a>
<img src="birevers.gif">
<hr>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -