Merged L & C issue fixes & HTML conversions from trunk to branch.

[SVN r36281]
This commit is contained in:
Andreas Huber 2006-12-05 22:33:21 +00:00
parent 30a40f9f76
commit 09f7aab52d
6 changed files with 1065 additions and 1197 deletions

View File

@ -1,116 +1,109 @@
<HTML> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
-- Copyright (c) Jeremy Siek 2000 <html>
-- <head>
-- Permission to use, copy, modify, distribute and sell this software <meta http-equiv="Content-Language" content="en-us">
-- and its documentation for any purpose is hereby granted without fee, <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear <title>Assignable</title>
-- in supporting documentation. Silicon Graphics makes no </head>
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty. <body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
--> "#FF0000">
<Head> <img src="../../boost.png" alt="C++ Boost" width="277" height=
<Title>Assignable</Title> "86"><br clear="none">
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" <h1>Assignable</h1>
ALINK="#ff0000">
<IMG SRC="../../boost.png"
ALT="C++ Boost" width="277" height="86">
<!--end header-->
<BR Clear>
<H1>Assignable</H1>
<h3>Description</h3> <h3>Description</h3>
A type is Assignable if it is possible to assign one object of the type
to another object of that type.
<p>A type is Assignable if it is possible to assign one object of the type
to another object of that type.</p>
<h3>Notation</h3> <h3>Notation</h3>
<Table>
<TR>
<TD VAlign=top>
<tt>T</tt>
</TD>
<TD VAlign=top>
is type that is a model of Assignable
</TD>
</TR>
<TR> <table summary="">
<TD VAlign=top> <tr>
<tt>t</tt> <td valign="top"><tt>T</tt></td>
</TD>
<TD VAlign=top> <td valign="top">is type that is a model of Assignable</td>
is an object of type <tt>T</tt>
</TD>
</tr> </tr>
<TR> <tr>
<TD VAlign=top> <td valign="top"><tt>t</tt></td>
<tt>u</tt>
</TD> <td valign="top">is an object of type <tt>T</tt></td>
<TD VAlign=top>
is an object of type <tt>T</tt> or possibly <tt>const T</tt>
</TD>
</tr> </tr>
<tr>
<td valign="top"><tt>u</tt></td>
<td valign="top">is an object of type <tt>T</tt> or possibly <tt>const
T</tt></td>
</tr>
</table> </table>
<h3>Definitions</h3> <h3>Definitions</h3>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border>
<TR>
<TH>
Name
</TH>
<TH>
Expression
</TH>
<TH>
Return type
</TH>
<TH>
Semantics
</TH>
</TR>
<TR>
<TD VAlign=top>
Assignment
</TD>
<TD VAlign=top>
<tt>t = u</tt>
</TD>
<TD VAlign=top>
<tt>T&amp;</tt>
</TD>
<TD VAlign=top>
<tt>t</tt> is equivalent to <tt>u</tt>
</TD>
</TR>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Assignment</td>
<td valign="top"><tt>t = u</tt></td>
<td valign="top"><tt>T&amp;</tt></td>
<td valign="top"><tt>t</tt> is equivalent to <tt>u</tt></td>
</tr>
</table> </table>
</table>
<h3>Models</h3> <h3>Models</h3>
<UL> <ul>
<LI><tt>int</tt> <li><tt>int</tt></li>
<LI><tt>std::pair</tt>
</UL> <li><tt>std::pair</tt></li>
</ul>
<h3>See also</h3> <h3>See also</h3>
<a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</A>
and
<A href="./CopyConstructible.html">CopyConstructible</A>
<br> <p><a href=
<HR> "http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
<TABLE> and <a href="./CopyConstructible.html">CopyConstructible</a><br></p>
<TR valign=top> <hr>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF=http://www.lsc.nd.edu/~jsiek>Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY> <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
</HTML> "http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05 December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,177 +1,138 @@
<HTML> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
-- Copyright (c) Jeremy Siek 2000 <html>
-- <head>
-- Permission to use, copy, modify, distribute and sell this software <meta http-equiv="Content-Language" content="en-us">
-- and its documentation for any purpose is hereby granted without fee, <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear <title>Copy Constructible</title>
-- in supporting documentation. Silicon Graphics makes no </head>
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty. <body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
--> "#FF0000">
<Head> <img src="../../boost.png" alt="C++ Boost" width="277" height=
<Title>Copy Constructible</Title> "86"><br clear="none">
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" <h1>Copy Constructible</h1>
ALINK="#ff0000">
<IMG SRC="../../boost.png"
ALT="C++ Boost" width="277" height="86">
<!--end header-->
<BR Clear>
<H1>Copy Constructible</H1>
<h3>Description</h3> <h3>Description</h3>
A type is Copy Constructible if it is possible to copy objects of that
type. <p>A type is Copy Constructible if it is possible to copy objects of that
type.</p>
<h3>Notation</h3> <h3>Notation</h3>
<Table>
<TR>
<TD VAlign=top>
<tt>T</tt>
</TD>
<TD VAlign=top>
is type that is a model of Copy Constructible
</TD>
</TR>
<TR> <table summary="">
<TD VAlign=top> <tr>
<tt>t</tt> <td valign="top"><tt>T</tt></td>
</TD>
<TD VAlign=top> <td valign="top">is type that is a model of Copy Constructible</td>
is an object of type <tt>T</tt>
</TD>
</tr> </tr>
<TR> <tr>
<TD VAlign=top> <td valign="top"><tt>t</tt></td>
<tt>u</tt>
</TD> <td valign="top">is an object of type <tt>T</tt></td>
<TD VAlign=top>
is an object of type <tt>const T</tt>
</TD>
</tr> </tr>
<tr>
<td valign="top"><tt>u</tt></td>
<td valign="top">is an object of type <tt>const T</tt></td>
</tr>
</table> </table>
<h3>Definitions</h3> <h3>Definitions</h3>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border>
<TR>
<TH>
Name
</TH>
<TH>
Expression
</TH>
<TH>
Return type
</TH>
<TH>
Semantics
</TH>
</TR>
<TR>
<TD VAlign=top>
Copy constructor
</TD>
<TD VAlign=top>
<tt>T(t)</tt>
</TD>
<TD VAlign=top>
<tt>T</tt>
</TD>
<TD VAlign=top>
<tt>t</tt> is equivalent to <tt>T(t)</tt>
</TD>
</TR>
<table border summary="">
<tr>
<th>Name</th>
<TR> <th>Expression</th>
<TD VAlign=top>
Copy constructor <th>Return type</th>
</TD>
<TD VAlign=top> <th>Semantics</th>
</tr>
<tr>
<td valign="top">Copy constructor</td>
<td valign="top"><tt>T(t)</tt></td>
<td valign="top"><tt>T</tt></td>
<td valign="top"><tt>t</tt> is equivalent to <tt>T(t)</tt></td>
</tr>
<tr>
<td valign="top">Copy constructor</td>
<td valign="top">
<pre> <pre>
T(u) T(u)
</pre> </pre>
</TD> </td>
<TD VAlign=top>
<tt>T</tt>
</TD>
<TD VAlign=top>
<tt>u</tt> is equivalent to <tt>T(u)</tt>
</TD>
</TR>
<td valign="top"><tt>T</tt></td>
<TR> <td valign="top"><tt>u</tt> is equivalent to <tt>T(u)</tt></td>
<TD VAlign=top> </tr>
Destructor
</TD> <tr>
<TD VAlign=top> <td valign="top">Destructor</td>
<td valign="top">
<pre> <pre>
t.~T() t.~T()
</pre> </pre>
</TD> </td>
<TD VAlign=top>
<tt>T</tt>
</TD>
<TD VAlign=top>
&nbsp;
</TD>
</TR>
<TR> <td valign="top"><tt>T</tt></td>
<TD VAlign=top>
Address Operator <td valign="top">&nbsp;</td>
</TD> </tr>
<TD VAlign=top>
<tr>
<td valign="top">Address Operator</td>
<td valign="top">
<pre> <pre>
&amp;t &amp;t
</pre> </pre>
</TD> </td>
<TD VAlign=top>
<tt>T*</tt>
</TD>
<TD VAlign=top>
denotes the address of <tt>t</tt>
</TD>
</TR>
<TR> <td valign="top"><tt>T*</tt></td>
<TD VAlign=top>
Address Operator <td valign="top">denotes the address of <tt>t</tt></td>
</TD> </tr>
<TD VAlign=top>
<tr>
<td valign="top">Address Operator</td>
<td valign="top">
<pre> <pre>
&amp;u &amp;u
</pre> </pre>
</TD> </td>
<TD VAlign=top>
<tt>T*</tt>
</TD>
<TD VAlign=top>
denotes the address of <tt>u</tt>
</TD>
</TR>
<td valign="top"><tt>T*</tt></td>
<td valign="top">denotes the address of <tt>u</tt></td>
</tr>
</table> </table>
</table>
<h3>Models</h3> <h3>Models</h3>
<UL> <ul>
<LI><tt>int</tt> <li><tt>int</tt></li>
<LI><tt>std::pair</tt>
</UL> <li><tt>std::pair</tt></li>
</ul>
<h3>Concept Checking Class</h3> <h3>Concept Checking Class</h3>
<pre> <pre>
template &lt;class T&gt; template &lt;class T&gt;
struct CopyConstructibleConcept struct CopyConstructibleConcept
@ -193,18 +154,32 @@ denotes the address of <tt>u</tt>
</pre> </pre>
<h3>See also</h3> <h3>See also</h3>
<A
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</A>
and
<A hrefa="./Assignable.html">Assignable</A>
<br> <p><a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default
<HR> Constructible</a> and <a href="./Assignable.html">Assignable</a><br></p>
<TABLE> <hr>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF=http://www.lsc.nd.edu/~jsiek>Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY> <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
</HTML> "http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@ -1,212 +1,210 @@
<HTML> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!-- <!--
-- Copyright (c) Jeremy Siek 2000 == Copyright (c) 1996-1999
-- == Silicon Graphics Computer Systems, Inc.
-- Permission to use, copy, modify, distribute and sell this software ==
-- and its documentation for any purpose is hereby granted without fee, == Permission to use, copy, modify, distribute and sell this software
-- provided that the above copyright notice appears in all copies and == and its documentation for any purpose is hereby granted without fee,
-- that both that copyright notice and this permission notice appear == provided that the above copyright notice appears in all copies and
-- in supporting documentation. Silicon Graphics makes no == that both that copyright notice and this permission notice appear
-- representations about the suitability of this software for any == in supporting documentation. Silicon Graphics makes no
-- purpose. It is provided "as is" without express or implied warranty. == representations about the suitability of this software for any
== purpose. It is provided "as is" without express or implied warranty.
==
== Copyright (c) 1994
== Hewlett-Packard Company
==
== Permission to use, copy, modify, distribute and sell this software
== and its documentation for any purpose is hereby granted without fee,
== provided that the above copyright notice appears in all copies and
== that both that copyright notice and this permission notice appear
== in supporting documentation. Hewlett-Packard Company makes no
== representations about the suitability of this software for any
== purpose. It is provided "as is" without express or implied warranty.
==
--> -->
<!--
-- Copyright (c) 1996-1999 <head>
-- Silicon Graphics Computer Systems, Inc. <meta http-equiv="Content-Language" content="en-us">
-- <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee, <title>LessThanComparable</title>
-- provided that the above copyright notice appears in all copies and </head>
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no <body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
-- representations about the suitability of this software for any "#FF0000">
-- purpose. It is provided "as is" without express or implied warranty. <img src="../../boost.png" alt="C++ Boost" width="277" height=
-- "86"><br clear="none">
-- Copyright (c) 1994
-- Hewlett-Packard Company <h1>LessThanComparable</h1>
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Hewlett-Packard Company makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
--
-->
<Head>
<Title>LessThanComparable</Title>
</Head>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../boost.png"
ALT="C++ Boost" width="277" height="86">
<!--end header-->
<BR Clear>
<H1>LessThanComparable</H1>
<h3>Description</h3> <h3>Description</h3>
A type is LessThanComparable if it is ordered: it must
be possible to compare two objects of that type using <tt>operator&lt;</tt>, and
<tt>operator&lt;</tt> must be a strict weak ordering relation.
<p>A type is LessThanComparable if it is ordered: it must be possible to
compare two objects of that type using <tt>operator&lt;</tt>, and
<tt>operator&lt;</tt> must be a strict weak ordering relation.</p>
<h3>Refinement of</h3> <h3>Refinement of</h3>
<h3>Associated types</h3> <h3>Associated types</h3>
<h3>Notation</h3> <h3>Notation</h3>
<Table>
<TR> <table summary="">
<TD VAlign=top> <tr>
<tt>X</tt> <td valign="top"><tt>X</tt></td>
</TD>
<TD VAlign=top> <td valign="top">A type that is a model of LessThanComparable</td>
A type that is a model of LessThanComparable </tr>
</TD>
</TR> <tr>
<TR> <td valign="top"><tt>x</tt>, <tt>y</tt>, <tt>z</tt></td>
<TD VAlign=top>
<tt>x</tt>, <tt>y</tt>, <tt>z</tt> <td valign="top">Object of type <tt>X</tt></td>
</TD>
<TD VAlign=top>
Object of type <tt>X</tt>
</TD>
</tr> </tr>
</table> </table>
<h3>Definitions</h3> <h3>Definitions</h3>
Consider the relation <tt>!(x &lt; y) &amp;&amp; !(y &lt; x)</tt>. If this relation is
transitive (that is, if <tt>!(x &lt; y) &amp;&amp; !(y &lt; x) &amp;&amp; !(y &lt; z) &amp;&amp; !(z &lt; y)</tt> <p>Consider the relation <tt>!(x &lt; y) &amp;&amp; !(y &lt; x)</tt>. If
implies <tt>!(x &lt; z) &amp;&amp; !(z &lt; x)</tt>), then it satisfies the mathematical this relation is transitive (that is, if <tt>!(x &lt; y) &amp;&amp; !(y
&lt; x) &amp;&amp; !(y &lt; z) &amp;&amp; !(z &lt; y)</tt> implies <tt>!(x
&lt; z) &amp;&amp; !(z &lt; x)</tt>), then it satisfies the mathematical
definition of an equivalence relation. In this case, <tt>operator&lt;</tt> definition of an equivalence relation. In this case, <tt>operator&lt;</tt>
is a <i>strict weak ordering</i>. is a <i>strict weak ordering</i>.</p>
<P>
If <tt>operator&lt;</tt> is a strict weak ordering, and if each equivalence class <p>If <tt>operator&lt;</tt> is a strict weak ordering, and if each
has only a single element, then <tt>operator&lt;</tt> is a <i>total ordering</i>. equivalence class has only a single element, then <tt>operator&lt;</tt> is
a <i>total ordering</i>.</p>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border>
<TR> <table border summary="">
<TH> <tr>
Name <th>Name</th>
</TH>
<TH> <th>Expression</th>
Expression
</TH> <th>Type requirements</th>
<TH>
Type requirements <th>Return type</th>
</TH> </tr>
<TH>
Return type <tr>
</TH> <td valign="top">Less</td>
</TR>
<TR> <td valign="top"><tt>x &lt; y</tt></td>
<TD VAlign=top>
Less <td valign="top">&nbsp;</td>
</TD>
<TD VAlign=top> <td valign="top">Convertible to <tt>bool</tt></td>
<tt>x &lt; y</tt> </tr>
</TD>
<TD VAlign=top>
&nbsp;
</TD>
<TD VAlign=top>
Convertible to <tt>bool</tt>
</TD>
</TR>
</table> </table>
<h3>Expression semantics</h3> <h3>Expression semantics</h3>
<Table border>
<TR>
<TH>
Name
</TH>
<TH>
Expression
</TH>
<TH>
Precondition
</TH>
<TH>
Semantics
</TH>
<TH>
Postcondition
</TH>
</TR>
<TR>
<TD VAlign=top>
Less
</TD>
<TD VAlign=top>
<tt>x &lt; y</tt>
</TD>
<TD VAlign=top>
<tt>x</tt> and <tt>y</tt> are in the domain of <tt>&lt;</tt>
</TD>
<TD VAlign=top>
&nbsp;
</TD>
</table>
<table border summary="">
<tr>
<th>Name</th>
<h3>Complexity guarantees</h3> <th>Expression</th>
<h3>Invariants</h3>
<Table border> <th>Precondition</th>
<TR>
<TD VAlign=top> <th>Semantics</th>
Irreflexivity
</TD> <th>Postcondition</th>
<TD VAlign=top> </tr>
<tt>x &lt; x</tt> must be false.
</TD> <tr>
</TR> <td valign="top">Less</td>
<TR>
<TD VAlign=top> <td valign="top"><tt>x &lt; y</tt></td>
Antisymmetry
</TD> <td valign="top"><tt>x</tt> and <tt>y</tt> are in the domain of
<TD VAlign=top> <tt>&lt;</tt></td>
<tt>x &lt; y</tt> implies !(y &lt; x) <A href="#2">[2]</A>
</TD> <td valign="top">&nbsp;</td>
</TR>
<TR>
<TD VAlign=top>
Transitivity
</TD>
<TD VAlign=top>
<tt>x &lt; y</tt> and <tt>y &lt; z</tt> implies <tt>x &lt; z</tt> <A href="#3">[3]</A>
</TD>
</tr> </tr>
</table> </table>
<h3>Complexity guarantees</h3>
<h3>Invariants</h3>
<table border summary="">
<tr>
<td valign="top">Irreflexivity</td>
<td valign="top"><tt>x &lt; x</tt> must be false.</td>
</tr>
<tr>
<td valign="top">Antisymmetry</td>
<td valign="top"><tt>x &lt; y</tt> implies !(y &lt; x) <a href=
"#n2">[2]</a></td>
</tr>
<tr>
<td valign="top">Transitivity</td>
<td valign="top"><tt>x &lt; y</tt> and <tt>y &lt; z</tt> implies <tt>x
&lt; z</tt> <a href="#n3">[3]</a></td>
</tr>
</table>
<h3>Models</h3> <h3>Models</h3>
<UL>
<LI> <ul>
int <li>int</li>
</UL> </ul>
<h3>Notes</h3> <h3>Notes</h3>
<P><A name="1">[1]</A>
Only <tt>operator&lt;</tt> is fundamental; the other inequality operators <p><a name="n1" id="n1">[1]</a> Only <tt>operator&lt;</tt> is fundamental;
are essentially syntactic sugar. the other inequality operators are essentially syntactic sugar.</p>
<P><A name="2">[2]</A>
Antisymmetry is a theorem, not an axiom: it follows from <p><a name="n2" id="n2">[2]</a> Antisymmetry is a theorem, not an axiom: it
irreflexivity and transitivity. follows from irreflexivity and transitivity.</p>
<P><A name="3">[3]</A>
Because of irreflexivity and transitivity, <tt>operator&lt;</tt> always <p><a name="n3" id="n3">[3]</a> Because of irreflexivity and transitivity,
satisfies the definition of a <i>partial ordering</i>. The definition of <tt>operator&lt;</tt> always satisfies the definition of a <i>partial
a <i>strict weak ordering</i> is stricter, and the definition of a ordering</i>. The definition of a <i>strict weak ordering</i> is stricter,
<i>total ordering</i> is stricter still. and the definition of a <i>total ordering</i> is stricter still.</p>
<h3>See also</h3> <h3>See also</h3>
<A href="http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</A>, <A href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">StrictWeakOrdering</A>
<p><a href=
"http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>,
<a href=
"http://www.sgi.com/tech/stl/StrictWeakOrdering.html">StrictWeakOrdering</a><br>
</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<br> <p>Revised
<HR> <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
<TABLE> December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF=http://www.lsc.nd.edu/~jsiek>Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY> <table summary="">
</HTML> <tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@ -1,92 +1,95 @@
<HTML> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-->
<Head>
<Title>MultiPassInputIterator</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear> <html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<H2> <title>MultiPassInputIterator</title>
<A NAME="concept:MultiPassInputIterator"></A> </head>
Multi-Pass Input Iterator
</H2>
This concept is a refinement of <a <body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>, "#FF0000">
adding the requirements that the iterator can be used to make multiple <img src="../../boost.png" alt="C++ Boost" width="277" height=
passes through a range, and that if <TT>it1 == it2</TT> and "86"><br clear="none">
<TT>it1</TT> is dereferenceable then <TT>++it1 == ++it2</TT>. The
Multi-Pass Input Iterator is very similar to the <a
href="http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>. The
only difference is that a <a
href="http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>
requires the <TT>reference</TT> type to be <TT>value_type&amp;</TT>, whereas
MultiPassInputIterator is like <a
href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>
in that the <TT>reference</TT> type merely has to be convertible to
<TT>value_type</TT>.
<h2><a name="concept:MultiPassInputIterator" id=
"concept:MultiPassInputIterator"></a> Multi-Pass Input Iterator</h2>
<p>This concept is a refinement of <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>, adding
the requirements that the iterator can be used to make multiple passes
through a range, and that if <tt>it1 == it2</tt> and <tt>it1</tt> is
dereferenceable then <tt>++it1 == ++it2</tt>. The Multi-Pass Input Iterator
is very similar to the <a href=
"http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>.
The only difference is that a <a href=
"http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>
requires the <tt>reference</tt> type to be <tt>value_type&amp;</tt>,
whereas MultiPassInputIterator is like <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a> in that
the <tt>reference</tt> type merely has to be convertible to
<tt>value_type</tt>.</p>
<h3>Design Notes</h3> <h3>Design Notes</h3>
comments by Valentin Bonnard: <p>comments by Valentin Bonnard:</p>
<p>I think that introducing Multi-Pass Input Iterator isn't the right <p>I think that introducing Multi-Pass Input Iterator isn't the right
solution. Do you also want to define Multi-Pass Bidirectionnal Iterator solution. Do you also want to define Multi-Pass Bidirectionnal Iterator and
and Multi-Pass Random Access Iterator ? I don't, definitly. It only Multi-Pass Random Access Iterator ? I don't, definitly. It only confuses
confuses the issue. The problem lies into the existing hierarchy of the issue. The problem lies into the existing hierarchy of iterators, which
iterators, which mixes movabillity, modifiabillity and lvalue-ness, mixes movabillity, modifiabillity and lvalue-ness, and these are clearly
and these are clearly independant. independant.</p>
<p>The terms Forward, Bidirectionnal and Random Access are about <p>The terms Forward, Bidirectionnal and Random Access are about
movabillity and shouldn't be used to mean anything else. In a movabillity and shouldn't be used to mean anything else. In a completly
completly orthogonal way, iterators can be immutable, mutable, or orthogonal way, iterators can be immutable, mutable, or neither. Lvalueness
neither. Lvalueness of iterators is also orthogonal with of iterators is also orthogonal with immutabillity. With these clean
immutabillity. With these clean concepts, your Multi-Pass Input Iterator concepts, your Multi-Pass Input Iterator is just called a Forward
is just called a Forward Iterator. Iterator.</p>
<p> <p>Other translations are:<br>
Other translations are:<br> std::Forward Iterator -&gt; ForwardIterator &amp; Lvalue Iterator<br>
std::Forward Iterator -> ForwardIterator & Lvalue Iterator<br> std::Bidirectionnal Iterator -&gt; Bidirectionnal Iterator &amp; Lvalue
std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue Iterator<br> Iterator<br>
std::Random Access Iterator -> Random Access Iterator & Lvalue Iterator<br> std::Random Access Iterator -&gt; Random Access Iterator &amp; Lvalue
Iterator<br></p>
<p> <p>Note that in practice the only operation not allowed on my Forward
Note that in practice the only operation not allowed on my Iterator which is allowed on std::Forward Iterator is <tt>&amp;*it</tt>. I
Forward Iterator which is allowed on std::Forward Iterator is think that <tt>&amp;*</tt> is rarely needed in generic code.</p>
<tt>&*it</tt>. I think that <tt>&*</tt> is rarely needed in generic code.
<p> <p>reply by Jeremy Siek:</p>
reply by Jeremy Siek:
<p> <p>The above analysis by Valentin is right on. Of course, there is the
The above analysis by Valentin is right on. Of course, there is problem with backward compatibility. The current STL implementations are
the problem with backward compatibility. The current STL implementations based on the old definition of Forward Iterator. The right course of action
are based on the old definition of Forward Iterator. The right course is to get Forward Iterator, etc. changed in the C++ standard. Once that is
of action is to get Forward Iterator, etc. changed in the C++ standard. done we can drop Multi-Pass Input Iterator.<br></p>
Once that is done we can drop Multi-Pass Input Iterator. <hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<br> <p>Revised
<HR> <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
<TABLE> December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<a HREF="../../people/jeremy_siek.htm">Jeremy Siek</a>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY> <table summary="">
</HTML> <tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@ -1,28 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Generator Iterator Adaptor Documentation</title> <title>Generator Iterator Adaptor Documentation</title>
</head> </head>
<body bgcolor="#FFFFFF" text="#000000"> <body bgcolor="#FFFFFF" text="#000000">
<img src="../../boost.png" alt="boost.png (6897 bytes)" align="middle"
<img src="../../boost.png" alt="boost.png (6897 bytes)" align="center" width="277" height="86"> width="277" height="86">
<h1>Generator Iterator Adaptor</h1> <h1>Generator Iterator Adaptor</h1>
Defined in header <a href="../../boost/generator_iterator.hpp">boost/generator_iterator.hpp</a>
<p> <p>Defined in header <a href=
The generator iterator adaptor makes it easier to create custom input "../../boost/generator_iterator.hpp">boost/generator_iterator.hpp</a></p>
iterators from 0-ary functions and function objects. The adaptor
takes a <p>The generator iterator adaptor makes it easier to create custom input
<a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a> iterators from 0-ary functions and function objects. The adaptor takes a
and creates a model of <a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a> and
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>. creates a model of <a href=
Each increment retrieves an item from the generator and makes it "http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>. Each
available to be retrieved by dereferencing. The motivation for this increment retrieves an item from the generator and makes it available to be
iterator is that some concepts can be more naturally expressed as a retrieved by dereferencing. The motivation for this iterator is that some
generator, while most STL algorithms expect an iterator. An example concepts can be more naturally expressed as a generator, while most STL
is the <a href="../random/index.html">Random Number</a> library. algorithms expect an iterator. An example is the <a href=
"../random/index.html">Random Number</a> library.</p>
<h2>Synopsis</h2> <h2>Synopsis</h2>
@ -41,20 +45,18 @@ namespace boost {
} }
</pre> </pre>
</blockquote> </blockquote>
<hr> <hr>
<h2>The Generator Iterator Generator Class</h2> <h2>The Generator Iterator Generator Class</h2>
The class generator_iterator_generator is a helper class whose purpose <p>The class generator_iterator_generator is a helper class whose purpose
is to construct a generator iterator type. The template parameter for is to construct a generator iterator type. The template parameter for this
this class is the Generator function object type that is being class is the Generator function object type that is being wrapped. The
wrapped. The generator iterator adaptor only holds a reference (or generator iterator adaptor only holds a reference (or pointer) to the
pointer) to the function object, therefore the function object must function object, therefore the function object must outlive the generator
outlive the generator iterator adaptor constructed from it. iterator adaptor constructed from it.</p>
<pre> <pre>
template &lt;class Generator> template &lt;class Generator&gt;
class generator_iterator_generator class generator_iterator_generator
{ {
public: public:
@ -62,44 +64,46 @@ public:
} }
</pre> </pre>
<h3>Template Parameters</h3> <h3>Template Parameters</h3>
<table border> <table border summary="">
<tr> <tr>
<th>Parameter</th> <th>Parameter</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td><tt><a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a></tt> <td><tt><a href=
<td>The generator (0-ary function object) type being "http://www.sgi.com/tech/stl/Generator.html">Generator</a></tt></td>
wrapped. The return type of the function must be defined as
<tt>Generator::result_type</tt>. The function object must be a model <td>The generator (0-ary function object) type being wrapped. The
of return type of the function must be defined as
<a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a>. <tt>Generator::result_type</tt>. The function object must be a model of
</td> <a href=
"http://www.sgi.com/tech/stl/Generator.html">Generator</a>.</td>
</tr>
</table> </table>
<h3>Concept Model</h3> <h3>Concept Model</h3>
The generator iterator class is a model of
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>. <p>The generator iterator class is a model of <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>.</p>
<h3>Members</h3> <h3>Members</h3>
The generator iterator implements the member functions
and operators required of the
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>
concept.
<br>
<p>The generator iterator implements the member functions and operators
required of the <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>
concept.<br></p>
<hr> <hr>
<h2><a name="make_generator_iterator">The Generator Iterator Object Generator</a></h2>
The <tt>make_generator_iterator()</tt> function provides a <h2><a name="make_generator_iterator" id="make_generator_iterator">The
convenient way to create generator iterator objects. The function Generator Iterator Object Generator</a></h2>
saves the user the trouble of explicitly writing out the iterator
types. <p>The <tt>make_generator_iterator()</tt> function provides a convenient
way to create generator iterator objects. The function saves the user the
trouble of explicitly writing out the iterator types.</p>
<blockquote> <blockquote>
<pre> <pre>
@ -108,19 +112,17 @@ typename generator_iterator_generator&lt;Generator&gt;::type
make_generator_iterator(Generator &amp; gen); make_generator_iterator(Generator &amp; gen);
</pre> </pre>
</blockquote> </blockquote>
<hr> <hr>
<h3>Example</h3> <h3>Example</h3>
The following program shows how <code>generator_iterator</code> <p>The following program shows how <code>generator_iterator</code>
transforms a generator into an input iterator. transforms a generator into an input iterator.</p>
<blockquote> <blockquote>
<pre> <pre>
#include &lt;iostream> #include &lt;iostream&gt;
#include &lt;boost/generator_iterator.hpp> #include &lt;boost/generator_iterator.hpp&gt;
class my_generator class my_generator
{ {
@ -141,10 +143,21 @@ int main()
} }
</pre> </pre>
</blockquote> </blockquote>
<hr> <hr>
Written by Jens Maurer. <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05 December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2001 <a href=
"../../people/jens_maurer.htm">Jens Maurer</a></i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body> </body>
</html> </html>