mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 23:14:02 +00:00
Merged L & C issue fixes & HTML conversions from trunk to branch.
[SVN r36281]
This commit is contained in:
parent
30a40f9f76
commit
09f7aab52d
199
Assignable.html
199
Assignable.html
@ -1,116 +1,109 @@
|
|||||||
<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>Assignable</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>Assignable</H1>
|
|
||||||
|
|
||||||
<h3>Description</h3>
|
<html>
|
||||||
A type is Assignable if it is possible to assign one object of the type
|
<head>
|
||||||
to another object of that type.
|
<meta http-equiv="Content-Language" content="en-us">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||||
|
|
||||||
|
<title>Assignable</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
<h3>Notation</h3>
|
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||||
<Table>
|
"#FF0000">
|
||||||
<TR>
|
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||||
<TD VAlign=top>
|
"86"><br clear="none">
|
||||||
<tt>T</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
is type that is a model of Assignable
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
<h1>Assignable</h1>
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>t</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
is an object of type <tt>T</tt>
|
|
||||||
</TD>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<TR>
|
<h3>Description</h3>
|
||||||
<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>
|
<p>A type is Assignable if it is possible to assign one object of the type
|
||||||
<h3>Definitions</h3>
|
to another object of that type.</p>
|
||||||
<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&</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>t</tt> is equivalent to <tt>u</tt>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
</table>
|
<h3>Notation</h3>
|
||||||
|
|
||||||
|
<table summary="">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><tt>T</tt></td>
|
||||||
|
|
||||||
</table>
|
<td valign="top">is type that is a model of Assignable</td>
|
||||||
<h3>Models</h3>
|
</tr>
|
||||||
|
|
||||||
<UL>
|
<tr>
|
||||||
<LI><tt>int</tt>
|
<td valign="top"><tt>t</tt></td>
|
||||||
<LI><tt>std::pair</tt>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<h3>See also</h3>
|
<td valign="top">is an object of type <tt>T</tt></td>
|
||||||
<a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</A>
|
</tr>
|
||||||
and
|
|
||||||
<A href="./CopyConstructible.html">CopyConstructible</A>
|
|
||||||
|
|
||||||
<br>
|
<tr>
|
||||||
<HR>
|
<td valign="top"><tt>u</tt></td>
|
||||||
<TABLE>
|
|
||||||
<TR valign=top>
|
|
||||||
<TD nowrap>Copyright © 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>
|
<td valign="top">is an object of type <tt>T</tt> or possibly <tt>const
|
||||||
</HTML>
|
T</tt></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Definitions</h3>
|
||||||
|
|
||||||
|
<h3>Valid expressions</h3>
|
||||||
|
|
||||||
|
<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&</tt></td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>t</tt> is equivalent to <tt>u</tt></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Models</h3>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><tt>int</tt></li>
|
||||||
|
|
||||||
|
<li><tt>std::pair</tt></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>See also</h3>
|
||||||
|
|
||||||
|
<p><a href=
|
||||||
|
"http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
|
||||||
|
and <a href="./CopyConstructible.html">CopyConstructible</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>
|
||||||
|
|
||||||
|
<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 © 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>
|
||||||
|
1036
Collection.html
1036
Collection.html
File diff suppressed because it is too large
Load Diff
@ -1,178 +1,139 @@
|
|||||||
<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>Copy Constructible</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>Copy Constructible</H1>
|
|
||||||
|
|
||||||
<h3>Description</h3>
|
<html>
|
||||||
A type is Copy Constructible if it is possible to copy objects of that
|
<head>
|
||||||
type.
|
<meta http-equiv="Content-Language" content="en-us">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||||
|
|
||||||
<h3>Notation</h3>
|
<title>Copy Constructible</title>
|
||||||
<Table>
|
</head>
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>T</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
is type that is a model of Copy Constructible
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||||
<TD VAlign=top>
|
"#FF0000">
|
||||||
<tt>t</tt>
|
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||||
</TD>
|
"86"><br clear="none">
|
||||||
<TD VAlign=top>
|
|
||||||
is an object of type <tt>T</tt>
|
|
||||||
</TD>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<TR>
|
<h1>Copy Constructible</h1>
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>u</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
is an object of type <tt>const T</tt>
|
|
||||||
</TD>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
<h3>Description</h3>
|
||||||
<h3>Definitions</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>
|
|
||||||
|
|
||||||
|
<p>A type is Copy Constructible if it is possible to copy objects of that
|
||||||
|
type.</p>
|
||||||
|
|
||||||
<TR>
|
<h3>Notation</h3>
|
||||||
<TD VAlign=top>
|
|
||||||
Copy constructor
|
<table summary="">
|
||||||
</TD>
|
<tr>
|
||||||
<TD VAlign=top>
|
<td valign="top"><tt>T</tt></td>
|
||||||
<pre>
|
|
||||||
|
<td valign="top">is type that is a model of Copy Constructible</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><tt>t</tt></td>
|
||||||
|
|
||||||
|
<td valign="top">is an object of type <tt>T</tt></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><tt>u</tt></td>
|
||||||
|
|
||||||
|
<td valign="top">is an object of type <tt>const T</tt></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Definitions</h3>
|
||||||
|
|
||||||
|
<h3>Valid expressions</h3>
|
||||||
|
|
||||||
|
<table border summary="">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top">Copy constructor</td>
|
||||||
|
|
||||||
|
<td valign="top">
|
||||||
|
<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>
|
||||||
<pre>
|
|
||||||
|
<td valign="top">
|
||||||
|
<pre>
|
||||||
t.~T()
|
t.~T()
|
||||||
</pre>
|
</pre>
|
||||||
</TD>
|
</td>
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>T</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
<td valign="top"><tt>T</tt></td>
|
||||||
<TD VAlign=top>
|
|
||||||
Address Operator
|
<td valign="top"> </td>
|
||||||
</TD>
|
</tr>
|
||||||
<TD VAlign=top>
|
|
||||||
<pre>
|
<tr>
|
||||||
|
<td valign="top">Address Operator</td>
|
||||||
|
|
||||||
|
<td valign="top">
|
||||||
|
<pre>
|
||||||
&t
|
&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>
|
|
||||||
<pre>
|
<tr>
|
||||||
|
<td valign="top">Address Operator</td>
|
||||||
|
|
||||||
|
<td valign="top">
|
||||||
|
<pre>
|
||||||
&u
|
&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>
|
<h3>Models</h3>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><tt>int</tt></li>
|
||||||
|
|
||||||
</table>
|
<li><tt>std::pair</tt></li>
|
||||||
<h3>Models</h3>
|
</ul>
|
||||||
|
|
||||||
<UL>
|
<h3>Concept Checking Class</h3>
|
||||||
<LI><tt>int</tt>
|
<pre>
|
||||||
<LI><tt>std::pair</tt>
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<h3>Concept Checking Class</h3>
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct CopyConstructibleConcept
|
struct CopyConstructibleConcept
|
||||||
{
|
{
|
||||||
@ -192,19 +153,33 @@ 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 © 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 © 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>
|
||||||
|
@ -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
|
|
||||||
-- 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,
|
|
||||||
-- 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.
|
|
||||||
--
|
|
||||||
-- 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.
|
|
||||||
--
|
|
||||||
-->
|
|
||||||
<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>
|
<head>
|
||||||
A type is LessThanComparable if it is ordered: it must
|
<meta http-equiv="Content-Language" content="en-us">
|
||||||
be possible to compare two objects of that type using <tt>operator<</tt>, and
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||||
<tt>operator<</tt> must be a strict weak ordering relation.
|
|
||||||
|
|
||||||
|
<title>LessThanComparable</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
<h3>Refinement of</h3>
|
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||||
<h3>Associated types</h3>
|
"#FF0000">
|
||||||
<h3>Notation</h3>
|
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||||
<Table>
|
"86"><br clear="none">
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>X</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
A type that is a model of LessThanComparable
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x</tt>, <tt>y</tt>, <tt>z</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Object of type <tt>X</tt>
|
|
||||||
</TD>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<h3>Definitions</h3>
|
|
||||||
Consider the relation <tt>!(x < y) && !(y < x)</tt>. If this relation is
|
|
||||||
transitive (that is, if <tt>!(x < y) && !(y < x) && !(y < z) && !(z < y)</tt>
|
|
||||||
implies <tt>!(x < z) && !(z < x)</tt>), then it satisfies the mathematical
|
|
||||||
definition of an equivalence relation. In this case, <tt>operator<</tt>
|
|
||||||
is a <i>strict weak ordering</i>.
|
|
||||||
<P>
|
|
||||||
If <tt>operator<</tt> is a strict weak ordering, and if each equivalence class
|
|
||||||
has only a single element, then <tt>operator<</tt> is a <i>total ordering</i>.
|
|
||||||
<h3>Valid expressions</h3>
|
|
||||||
<Table border>
|
|
||||||
<TR>
|
|
||||||
<TH>
|
|
||||||
Name
|
|
||||||
</TH>
|
|
||||||
<TH>
|
|
||||||
Expression
|
|
||||||
</TH>
|
|
||||||
<TH>
|
|
||||||
Type requirements
|
|
||||||
</TH>
|
|
||||||
<TH>
|
|
||||||
Return type
|
|
||||||
</TH>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Less
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x < y</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Convertible to <tt>bool</tt>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
<h1>LessThanComparable</h1>
|
||||||
|
|
||||||
|
<h3>Description</h3>
|
||||||
|
|
||||||
<h3>Expression semantics</h3>
|
<p>A type is LessThanComparable if it is ordered: it must be possible to
|
||||||
<Table border>
|
compare two objects of that type using <tt>operator<</tt>, and
|
||||||
<TR>
|
<tt>operator<</tt> must be a strict weak ordering relation.</p>
|
||||||
<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 < y</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x</tt> and <tt>y</tt> are in the domain of <tt><</tt>
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
<h3>Refinement of</h3>
|
||||||
|
|
||||||
<h3>Complexity guarantees</h3>
|
<h3>Associated types</h3>
|
||||||
<h3>Invariants</h3>
|
|
||||||
<Table border>
|
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Irreflexivity
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x < x</tt> must be false.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Antisymmetry
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x < y</tt> implies !(y < x) <A href="#2">[2]</A>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR>
|
|
||||||
<TD VAlign=top>
|
|
||||||
Transitivity
|
|
||||||
</TD>
|
|
||||||
<TD VAlign=top>
|
|
||||||
<tt>x < y</tt> and <tt>y < z</tt> implies <tt>x < z</tt> <A href="#3">[3]</A>
|
|
||||||
</TD>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<h3>Models</h3>
|
|
||||||
<UL>
|
|
||||||
<LI>
|
|
||||||
int
|
|
||||||
</UL>
|
|
||||||
<h3>Notes</h3>
|
|
||||||
<P><A name="1">[1]</A>
|
|
||||||
Only <tt>operator<</tt> is fundamental; the other inequality operators
|
|
||||||
are essentially syntactic sugar.
|
|
||||||
<P><A name="2">[2]</A>
|
|
||||||
Antisymmetry is a theorem, not an axiom: it follows from
|
|
||||||
irreflexivity and transitivity.
|
|
||||||
<P><A name="3">[3]</A>
|
|
||||||
Because of irreflexivity and transitivity, <tt>operator<</tt> always
|
|
||||||
satisfies the definition of a <i>partial ordering</i>. The definition of
|
|
||||||
a <i>strict weak ordering</i> is stricter, and the definition of a
|
|
||||||
<i>total ordering</i> is stricter still.
|
|
||||||
<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>
|
|
||||||
|
|
||||||
|
<h3>Notation</h3>
|
||||||
|
|
||||||
|
<table summary="">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><tt>X</tt></td>
|
||||||
|
|
||||||
<br>
|
<td valign="top">A type that is a model of LessThanComparable</td>
|
||||||
<HR>
|
</tr>
|
||||||
<TABLE>
|
|
||||||
<TR valign=top>
|
|
||||||
<TD nowrap>Copyright © 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>
|
<tr>
|
||||||
</HTML>
|
<td valign="top"><tt>x</tt>, <tt>y</tt>, <tt>z</tt></td>
|
||||||
|
|
||||||
|
<td valign="top">Object of type <tt>X</tt></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Definitions</h3>
|
||||||
|
|
||||||
|
<p>Consider the relation <tt>!(x < y) && !(y < x)</tt>. If
|
||||||
|
this relation is transitive (that is, if <tt>!(x < y) && !(y
|
||||||
|
< x) && !(y < z) && !(z < y)</tt> implies <tt>!(x
|
||||||
|
< z) && !(z < x)</tt>), then it satisfies the mathematical
|
||||||
|
definition of an equivalence relation. In this case, <tt>operator<</tt>
|
||||||
|
is a <i>strict weak ordering</i>.</p>
|
||||||
|
|
||||||
|
<p>If <tt>operator<</tt> is a strict weak ordering, and if each
|
||||||
|
equivalence class has only a single element, then <tt>operator<</tt> is
|
||||||
|
a <i>total ordering</i>.</p>
|
||||||
|
|
||||||
|
<h3>Valid expressions</h3>
|
||||||
|
|
||||||
|
<table border summary="">
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
|
||||||
|
<th>Expression</th>
|
||||||
|
|
||||||
|
<th>Type requirements</th>
|
||||||
|
|
||||||
|
<th>Return type</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top">Less</td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>x < y</tt></td>
|
||||||
|
|
||||||
|
<td valign="top"> </td>
|
||||||
|
|
||||||
|
<td valign="top">Convertible to <tt>bool</tt></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Expression semantics</h3>
|
||||||
|
|
||||||
|
<table border summary="">
|
||||||
|
<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 < y</tt></td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>x</tt> and <tt>y</tt> are in the domain of
|
||||||
|
<tt><</tt></td>
|
||||||
|
|
||||||
|
<td valign="top"> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Complexity guarantees</h3>
|
||||||
|
|
||||||
|
<h3>Invariants</h3>
|
||||||
|
|
||||||
|
<table border summary="">
|
||||||
|
<tr>
|
||||||
|
<td valign="top">Irreflexivity</td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>x < x</tt> must be false.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top">Antisymmetry</td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>x < y</tt> implies !(y < x) <a href=
|
||||||
|
"#n2">[2]</a></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign="top">Transitivity</td>
|
||||||
|
|
||||||
|
<td valign="top"><tt>x < y</tt> and <tt>y < z</tt> implies <tt>x
|
||||||
|
< z</tt> <a href="#n3">[3]</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Models</h3>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>int</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Notes</h3>
|
||||||
|
|
||||||
|
<p><a name="n1" id="n1">[1]</a> Only <tt>operator<</tt> is fundamental;
|
||||||
|
the other inequality operators are essentially syntactic sugar.</p>
|
||||||
|
|
||||||
|
<p><a name="n2" id="n2">[2]</a> Antisymmetry is a theorem, not an axiom: it
|
||||||
|
follows from irreflexivity and transitivity.</p>
|
||||||
|
|
||||||
|
<p><a name="n3" id="n3">[3]</a> Because of irreflexivity and transitivity,
|
||||||
|
<tt>operator<</tt> always satisfies the definition of a <i>partial
|
||||||
|
ordering</i>. The definition of a <i>strict weak ordering</i> is stricter,
|
||||||
|
and the definition of a <i>total ordering</i> is stricter still.</p>
|
||||||
|
|
||||||
|
<h3>See also</h3>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<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 © 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>
|
||||||
|
@ -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&</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>
|
||||||
|
|
||||||
<h3>Design Notes</h3>
|
<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&</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>
|
||||||
|
|
||||||
comments by Valentin Bonnard:
|
<h3>Design Notes</h3>
|
||||||
|
|
||||||
<p> I think that introducing Multi-Pass Input Iterator isn't the right
|
<p>comments by Valentin Bonnard:</p>
|
||||||
solution. Do you also want to define Multi-Pass Bidirectionnal Iterator
|
|
||||||
and Multi-Pass Random Access Iterator ? I don't, definitly. It only
|
|
||||||
confuses the issue. The problem lies into the existing hierarchy of
|
|
||||||
iterators, which mixes movabillity, modifiabillity and lvalue-ness,
|
|
||||||
and these are clearly independant.
|
|
||||||
|
|
||||||
<p> The terms Forward, Bidirectionnal and Random Access are about
|
<p>I think that introducing Multi-Pass Input Iterator isn't the right
|
||||||
movabillity and shouldn't be used to mean anything else. In a
|
solution. Do you also want to define Multi-Pass Bidirectionnal Iterator and
|
||||||
completly orthogonal way, iterators can be immutable, mutable, or
|
Multi-Pass Random Access Iterator ? I don't, definitly. It only confuses
|
||||||
neither. Lvalueness of iterators is also orthogonal with
|
the issue. The problem lies into the existing hierarchy of iterators, which
|
||||||
immutabillity. With these clean concepts, your Multi-Pass Input Iterator
|
mixes movabillity, modifiabillity and lvalue-ness, and these are clearly
|
||||||
is just called a Forward Iterator.
|
independant.</p>
|
||||||
|
|
||||||
<p>
|
<p>The terms Forward, Bidirectionnal and Random Access are about
|
||||||
Other translations are:<br>
|
movabillity and shouldn't be used to mean anything else. In a completly
|
||||||
std::Forward Iterator -> ForwardIterator & Lvalue Iterator<br>
|
orthogonal way, iterators can be immutable, mutable, or neither. Lvalueness
|
||||||
std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue Iterator<br>
|
of iterators is also orthogonal with immutabillity. With these clean
|
||||||
std::Random Access Iterator -> Random Access Iterator & Lvalue Iterator<br>
|
concepts, your Multi-Pass Input Iterator is just called a Forward
|
||||||
|
Iterator.</p>
|
||||||
|
|
||||||
<p>
|
<p>Other translations are:<br>
|
||||||
Note that in practice the only operation not allowed on my
|
std::Forward Iterator -> ForwardIterator & Lvalue Iterator<br>
|
||||||
Forward Iterator which is allowed on std::Forward Iterator is
|
std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue
|
||||||
<tt>&*it</tt>. I think that <tt>&*</tt> is rarely needed in generic code.
|
Iterator<br>
|
||||||
|
std::Random Access Iterator -> Random Access Iterator & Lvalue
|
||||||
|
Iterator<br></p>
|
||||||
|
|
||||||
<p>
|
<p>Note that in practice the only operation not allowed on my Forward
|
||||||
reply by Jeremy Siek:
|
Iterator which is allowed on std::Forward Iterator is <tt>&*it</tt>. I
|
||||||
|
think that <tt>&*</tt> is rarely needed in generic code.</p>
|
||||||
|
|
||||||
<p>
|
<p>reply by Jeremy Siek:</p>
|
||||||
The above analysis by Valentin is right on. Of course, there is
|
|
||||||
the problem with backward compatibility. The current STL implementations
|
|
||||||
are based on the old definition of Forward Iterator. The right course
|
|
||||||
of action is to get Forward Iterator, etc. changed in the C++ standard.
|
|
||||||
Once that is done we can drop Multi-Pass Input Iterator.
|
|
||||||
|
|
||||||
|
<p>The above analysis by Valentin is right on. Of course, there is the
|
||||||
|
problem with backward compatibility. The current STL implementations are
|
||||||
|
based on the old definition of Forward Iterator. The right course of action
|
||||||
|
is to get Forward Iterator, etc. changed in the C++ standard. Once that is
|
||||||
|
done we can drop Multi-Pass Input Iterator.<br></p>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<br>
|
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
|
||||||
<HR>
|
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
|
||||||
<TABLE>
|
height="31" width="88"></a></p>
|
||||||
<TR valign=top>
|
|
||||||
<TD nowrap>Copyright © 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>
|
<p>Revised
|
||||||
</HTML>
|
<!--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 © 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>
|
||||||
|
@ -1,33 +1,37 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Generator Iterator Adaptor Documentation</title>
|
<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>
|
||||||
</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>
|
|
||||||
The generator iterator adaptor makes it easier to create custom input
|
|
||||||
iterators from 0-ary functions and function objects. The adaptor
|
|
||||||
takes a
|
|
||||||
<a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a>
|
|
||||||
and creates a model of
|
|
||||||
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>.
|
|
||||||
Each increment retrieves an item from the generator and makes it
|
|
||||||
available to be retrieved by dereferencing. The motivation for this
|
|
||||||
iterator is that some concepts can be more naturally expressed as a
|
|
||||||
generator, while most STL algorithms expect an iterator. An example
|
|
||||||
is the <a href="../random/index.html">Random Number</a> library.
|
|
||||||
|
|
||||||
<h2>Synopsis</h2>
|
<p>Defined in header <a href=
|
||||||
|
"../../boost/generator_iterator.hpp">boost/generator_iterator.hpp</a></p>
|
||||||
|
|
||||||
<blockquote>
|
<p>The generator iterator adaptor makes it easier to create custom input
|
||||||
<pre>
|
iterators from 0-ary functions and function objects. The adaptor takes a
|
||||||
|
<a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a> and
|
||||||
|
creates a model of <a href=
|
||||||
|
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>. Each
|
||||||
|
increment retrieves an item from the generator and makes it available to be
|
||||||
|
retrieved by dereferencing. The motivation for this iterator is that some
|
||||||
|
concepts can be more naturally expressed as a generator, while most STL
|
||||||
|
algorithms expect an iterator. An example is the <a href=
|
||||||
|
"../random/index.html">Random Number</a> library.</p>
|
||||||
|
|
||||||
|
<h2>Synopsis</h2>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<pre>
|
||||||
namespace boost {
|
namespace boost {
|
||||||
template <class Generator>
|
template <class Generator>
|
||||||
class generator_iterator_policies;
|
class generator_iterator_policies;
|
||||||
@ -40,21 +44,19 @@ namespace boost {
|
|||||||
make_generator_iterator(Generator & gen);
|
make_generator_iterator(Generator & gen);
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<hr>
|
<h2>The Generator Iterator Generator Class</h2>
|
||||||
|
|
||||||
<h2>The Generator Iterator Generator Class</h2>
|
<p>The class generator_iterator_generator is a helper class whose purpose
|
||||||
|
is to construct a generator iterator type. The template parameter for this
|
||||||
The class generator_iterator_generator is a helper class whose purpose
|
class is the Generator function object type that is being wrapped. The
|
||||||
is to construct a generator iterator type. The template parameter for
|
generator iterator adaptor only holds a reference (or pointer) to the
|
||||||
this class is the Generator function object type that is being
|
function object, therefore the function object must outlive the generator
|
||||||
wrapped. The generator iterator adaptor only holds a reference (or
|
iterator adaptor constructed from it.</p>
|
||||||
pointer) to the function object, therefore the function object must
|
<pre>
|
||||||
outlive the generator iterator adaptor constructed from it.
|
template <class Generator>
|
||||||
|
|
||||||
<pre>
|
|
||||||
template <class Generator>
|
|
||||||
class generator_iterator_generator
|
class generator_iterator_generator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -62,65 +64,65 @@ public:
|
|||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h3>Template Parameters</h3>
|
||||||
|
|
||||||
<h3>Template Parameters</h3>
|
<table border summary="">
|
||||||
|
<tr>
|
||||||
|
<th>Parameter</th>
|
||||||
|
|
||||||
<table border>
|
<th>Description</th>
|
||||||
<tr>
|
</tr>
|
||||||
<th>Parameter</th>
|
|
||||||
<th>Description</th>
|
|
||||||
</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
|
|
||||||
of
|
|
||||||
<a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a>.
|
|
||||||
</td>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h3>Concept Model</h3>
|
<td>The generator (0-ary function object) type being wrapped. The
|
||||||
The generator iterator class is a model of
|
return type of the function must be defined as
|
||||||
<a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>.
|
<tt>Generator::result_type</tt>. The function object must be a model of
|
||||||
|
<a href=
|
||||||
|
"http://www.sgi.com/tech/stl/Generator.html">Generator</a>.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<h3>Members</h3>
|
<h3>Concept Model</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 class is a model of <a href=
|
||||||
|
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>.</p>
|
||||||
|
|
||||||
<hr>
|
<h3>Members</h3>
|
||||||
<h2><a name="make_generator_iterator">The Generator Iterator Object Generator</a></h2>
|
|
||||||
|
|
||||||
The <tt>make_generator_iterator()</tt> function provides a
|
<p>The generator iterator implements the member functions and operators
|
||||||
convenient way to create generator iterator objects. The function
|
required of the <a href=
|
||||||
saves the user the trouble of explicitly writing out the iterator
|
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>
|
||||||
types.
|
concept.<br></p>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<blockquote>
|
<h2><a name="make_generator_iterator" id="make_generator_iterator">The
|
||||||
<pre>
|
Generator Iterator Object Generator</a></h2>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<pre>
|
||||||
template <class Generator>
|
template <class Generator>
|
||||||
typename generator_iterator_generator<Generator>::type
|
typename generator_iterator_generator<Generator>::type
|
||||||
make_generator_iterator(Generator & gen);
|
make_generator_iterator(Generator & gen);
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<hr>
|
<h3>Example</h3>
|
||||||
|
|
||||||
|
<p>The following program shows how <code>generator_iterator</code>
|
||||||
|
transforms a generator into an input iterator.</p>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<blockquote>
|
||||||
|
<pre>
|
||||||
The following program shows how <code>generator_iterator</code>
|
#include <iostream>
|
||||||
transforms a generator into an input iterator.
|
#include <boost/generator_iterator.hpp>
|
||||||
|
|
||||||
<blockquote>
|
|
||||||
<pre>
|
|
||||||
#include <iostream>
|
|
||||||
#include <boost/generator_iterator.hpp>
|
|
||||||
|
|
||||||
class my_generator
|
class my_generator
|
||||||
{
|
{
|
||||||
@ -140,11 +142,22 @@ int main()
|
|||||||
std::cout << *it << std::endl;
|
std::cout << *it << std::endl;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
<hr>
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
Written by Jens Maurer.
|
<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 © 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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user