⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 out_3702.htm

📁 ARM编辑、编译软件
💻 HTM
字号:
<HTML><TITLE>Output Iterators</TITLE><BODY>
<A HREF="ref.htm"><IMG SRC="images/banner.gif"></A>
<P><STRONG>Click on the banner to return to the Class Reference home page.</STRONG></P>
<P>&copy;Copyright 1996 Rogue Wave Software</P>
<H2>Output Iterators</H2>
<HR><PRE>     Iterator</PRE><HR>
<A NAME="Summary"><H3>Summary</H3></A>
<P>A write-only, forward moving iterator.</P>
<H3>Contents</H3>
<UL>
<A HREF="#Description"><LI>Description</LI></A>
<A HREF="#Key to Iterator Requirements"><LI>Key to Iterator Requirements</LI></A>
<A HREF="#Requirements for Output Iterators"><LI>Requirements for Output Iterators</LI></A>
<A HREF="#See Also"><LI>See Also</LI></A>
</UL>
<A NAME="Description"><H3>Description</H3></A>
<HR><STRONG><P>For a complete discussion of iterators, see the <A HREF="Ite_5295.htm"><B><I>Iterators</B></I></A> section of this reference.</P></STRONG><HR>
<P>Iterators are a generalization of pointers that allow a C++ program to uniformly interact with different data structures.  Output iterators are write-only, forward moving iterators that satisfy the requirements listed below.  Note that unlike other iterators used with the standard library, output iterators cannot be constant.</P>
<A NAME="Key to Iterator Requirements"><H3>Key to Iterator Requirements</H3></A>
<P>The following key pertains to the iterator requirements listed below: </P>
<CENTER><TABLE CELLSPACING=3 CELLPADDING=3>
<TR VALIGN=top>
<TD><SAMP>a </SAMP>and<SAMP> b</SAMP></TD>
<TD>values of type <SAMP>X</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>n</SAMP></TD>
<TD>value of <SAMP>distance</SAMP> type</TD></TR>
<TR VALIGN=top>
<TD><SAMP>u, Distance, tmp </SAMP>and<SAMP> m</SAMP></TD>
<TD>identifiers</TD></TR>
<TR VALIGN=top>
<TD><SAMP>r</SAMP></TD>
<TD>value of type <SAMP>X&#38;</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>t</SAMP></TD>
<TD>value of type <SAMP>T</SAMP></TD></TR>
</TABLE></CENTER>
<A NAME="Requirements for Output Iterators"><H3>Requirements for Output Iterators</H3></A>
<P>The following expressions must be valid for output iterators:</P>
<CENTER><TABLE CELLSPACING=3 CELLPADDING=3>
<TR VALIGN=top>
<TD><SAMP>X(a)</SAMP></TD>
<TD>copy constructor, <SAMP>a == X(a)</SAMP>.</TD></TR>
<TR VALIGN=top>
<TD><SAMP>X u(a)</SAMP></TD>
<TD>copy constructor, <SAMP>u == a</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>X u = a</SAMP></TD>
<TD>assignment, <SAMP>u == a</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>*a = t</SAMP></TD>
<TD>result is not used</TD></TR>
<TR VALIGN=top>
<TD><SAMP>++r</SAMP></TD>
<TD>returns <SAMP>X&#38;</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>r++</SAMP></TD>
<TD>return value convertable to <SAMP>const X&#38;</SAMP></TD></TR>
<TR VALIGN=top>
<TD><SAMP>*r++ = t</SAMP></TD>
<TD>result is not used</TD></TR>
</TABLE></CENTER>
<P>The only valid use for the <SAMP>operator *</SAMP> is on the left hand side of the assignment statement.</P>
<P>Algorithms using output iterators should be single pass algorithms.  That is, they should not pass through the same iterator twice. </P>
<A NAME="See Also"><H3>See Also</H3></A>
<P><A HREF="Ite_5295.htm"><B><I>Iterators</B></I></A></P>
<HR>
<A HREF="ost_2238.htm"><IMG SRC="images/prev.gif"></A> <A HREF="ref.htm#contents"><IMG SRC="images/toc.gif"></A> <A HREF="pai_5818.htm"><IMG SRC="images/next.gif"></A></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -