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>
|
||||
<!--
|
||||
-- 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>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<h3>Description</h3>
|
||||
A type is Assignable if it is possible to assign one object of the type
|
||||
to another object of that type.
|
||||
<html>
|
||||
<head>
|
||||
<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>
|
||||
<Table>
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
<tt>T</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
is type that is a model of Assignable
|
||||
</TD>
|
||||
</TR>
|
||||
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||
"#FF0000">
|
||||
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||
"86"><br clear="none">
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
<tt>t</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
is an object of type <tt>T</tt>
|
||||
</TD>
|
||||
</tr>
|
||||
<h1>Assignable</h1>
|
||||
|
||||
<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>
|
||||
<h3>Description</h3>
|
||||
|
||||
</table>
|
||||
<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>
|
||||
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>
|
||||
<p>A type is Assignable if it is possible to assign one object of the type
|
||||
to another object of that type.</p>
|
||||
|
||||
</table>
|
||||
<h3>Notation</h3>
|
||||
|
||||
<table summary="">
|
||||
<tr>
|
||||
<td valign="top"><tt>T</tt></td>
|
||||
|
||||
</table>
|
||||
<h3>Models</h3>
|
||||
<td valign="top">is type that is a model of Assignable</td>
|
||||
</tr>
|
||||
|
||||
<UL>
|
||||
<LI><tt>int</tt>
|
||||
<LI><tt>std::pair</tt>
|
||||
</UL>
|
||||
<tr>
|
||||
<td valign="top"><tt>t</tt></td>
|
||||
|
||||
<h3>See also</h3>
|
||||
<a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</A>
|
||||
and
|
||||
<A href="./CopyConstructible.html">CopyConstructible</A>
|
||||
<td valign="top">is an object of type <tt>T</tt></td>
|
||||
</tr>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<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>
|
||||
<tr>
|
||||
<td valign="top"><tt>u</tt></td>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<td valign="top">is an object of type <tt>T</tt> or possibly <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">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>
|
||||
<!--
|
||||
-- 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>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<h3>Description</h3>
|
||||
A type is Copy Constructible if it is possible to copy objects of that
|
||||
type.
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
|
||||
<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>
|
||||
<title>Copy Constructible</title>
|
||||
</head>
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
<tt>t</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
is an object of type <tt>T</tt>
|
||||
</TD>
|
||||
</tr>
|
||||
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||
"#FF0000">
|
||||
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||
"86"><br clear="none">
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
<tt>u</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
is an object of type <tt>const T</tt>
|
||||
</TD>
|
||||
</tr>
|
||||
<h1>Copy Constructible</h1>
|
||||
|
||||
</table>
|
||||
<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>
|
||||
<h3>Description</h3>
|
||||
|
||||
<p>A type is Copy Constructible if it is possible to copy objects of that
|
||||
type.</p>
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
Copy constructor
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<pre>
|
||||
<h3>Notation</h3>
|
||||
|
||||
<table summary="">
|
||||
<tr>
|
||||
<td valign="top"><tt>T</tt></td>
|
||||
|
||||
<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)
|
||||
</pre>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<tt>T</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<tt>u</tt> is equivalent to <tt>T(u)</tt>
|
||||
</TD>
|
||||
</TR>
|
||||
</td>
|
||||
|
||||
<td valign="top"><tt>T</tt></td>
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
Destructor
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<pre>
|
||||
<td valign="top"><tt>u</tt> is equivalent to <tt>T(u)</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Destructor</td>
|
||||
|
||||
<td valign="top">
|
||||
<pre>
|
||||
t.~T()
|
||||
</pre>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<tt>T</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</td>
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
Address Operator
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<pre>
|
||||
<td valign="top"><tt>T</tt></td>
|
||||
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Address Operator</td>
|
||||
|
||||
<td valign="top">
|
||||
<pre>
|
||||
&t
|
||||
</pre>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<tt>T*</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
denotes the address of <tt>t</tt>
|
||||
</TD>
|
||||
</TR>
|
||||
</td>
|
||||
|
||||
<TR>
|
||||
<TD VAlign=top>
|
||||
Address Operator
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<pre>
|
||||
<td valign="top"><tt>T*</tt></td>
|
||||
|
||||
<td valign="top">denotes the address of <tt>t</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Address Operator</td>
|
||||
|
||||
<td valign="top">
|
||||
<pre>
|
||||
&u
|
||||
</pre>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
<tt>T*</tt>
|
||||
</TD>
|
||||
<TD VAlign=top>
|
||||
denotes the address of <tt>u</tt>
|
||||
</TD>
|
||||
</TR>
|
||||
</td>
|
||||
|
||||
<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>
|
||||
<h3>Models</h3>
|
||||
<li><tt>std::pair</tt></li>
|
||||
</ul>
|
||||
|
||||
<UL>
|
||||
<LI><tt>int</tt>
|
||||
<LI><tt>std::pair</tt>
|
||||
</UL>
|
||||
|
||||
<h3>Concept Checking Class</h3>
|
||||
|
||||
<pre>
|
||||
<h3>Concept Checking Class</h3>
|
||||
<pre>
|
||||
template <class T>
|
||||
struct CopyConstructibleConcept
|
||||
{
|
||||
@ -192,19 +153,33 @@ denotes the address of <tt>u</tt>
|
||||
};
|
||||
</pre>
|
||||
|
||||
<h3>See also</h3>
|
||||
<A
|
||||
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</A>
|
||||
and
|
||||
<A hrefa="./Assignable.html">Assignable</A>
|
||||
<h3>See also</h3>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<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>
|
||||
<p><a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default
|
||||
Constructible</a> and <a href="./Assignable.html">Assignable</a><br></p>
|
||||
<hr>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<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,212 +1,210 @@
|
||||
<HTML>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<!--
|
||||
-- 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.
|
||||
== 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.
|
||||
==
|
||||
-->
|
||||
<!--
|
||||
-- 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>
|
||||
A type is LessThanComparable if it is ordered: it must
|
||||
be possible to compare two objects of that type using <tt>operator<</tt>, and
|
||||
<tt>operator<</tt> must be a strict weak ordering relation.
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
|
||||
<title>LessThanComparable</title>
|
||||
</head>
|
||||
|
||||
<h3>Refinement of</h3>
|
||||
<h3>Associated types</h3>
|
||||
<h3>Notation</h3>
|
||||
<Table>
|
||||
<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>
|
||||
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||
"#FF0000">
|
||||
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||
"86"><br clear="none">
|
||||
|
||||
<h1>LessThanComparable</h1>
|
||||
|
||||
<h3>Description</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 < 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>
|
||||
<p>A type is LessThanComparable if it is ordered: it must be possible to
|
||||
compare two objects of that type using <tt>operator<</tt>, and
|
||||
<tt>operator<</tt> must be a strict weak ordering relation.</p>
|
||||
|
||||
<h3>Refinement of</h3>
|
||||
|
||||
<h3>Complexity guarantees</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>Associated types</h3>
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<table summary="">
|
||||
<tr>
|
||||
<td valign="top"><tt>X</tt></td>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<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>
|
||||
<td valign="top">A type that is a model of LessThanComparable</td>
|
||||
</tr>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<!--
|
||||
-- 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">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<BR Clear>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
|
||||
<H2>
|
||||
<A NAME="concept:MultiPassInputIterator"></A>
|
||||
Multi-Pass Input Iterator
|
||||
</H2>
|
||||
<title>MultiPassInputIterator</title>
|
||||
</head>
|
||||
|
||||
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>.
|
||||
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
|
||||
"#FF0000">
|
||||
<img src="../../boost.png" alt="C++ Boost" width="277" height=
|
||||
"86"><br clear="none">
|
||||
|
||||
<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
|
||||
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>comments by Valentin Bonnard:</p>
|
||||
|
||||
<p> The terms Forward, Bidirectionnal and Random Access are about
|
||||
movabillity and shouldn't be used to mean anything else. In a
|
||||
completly orthogonal way, iterators can be immutable, mutable, or
|
||||
neither. Lvalueness of iterators is also orthogonal with
|
||||
immutabillity. With these clean concepts, your Multi-Pass Input Iterator
|
||||
is just called a Forward Iterator.
|
||||
<p>I think that introducing Multi-Pass Input Iterator isn't the right
|
||||
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>
|
||||
|
||||
<p>
|
||||
Other translations are:<br>
|
||||
std::Forward Iterator -> ForwardIterator & Lvalue Iterator<br>
|
||||
std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue Iterator<br>
|
||||
std::Random Access Iterator -> Random Access Iterator & Lvalue Iterator<br>
|
||||
<p>The terms Forward, Bidirectionnal and Random Access are about
|
||||
movabillity and shouldn't be used to mean anything else. In a completly
|
||||
orthogonal way, iterators can be immutable, mutable, or neither. Lvalueness
|
||||
of iterators is also orthogonal with immutabillity. With these clean
|
||||
concepts, your Multi-Pass Input Iterator is just called a Forward
|
||||
Iterator.</p>
|
||||
|
||||
<p>
|
||||
Note that in practice the only operation not allowed on my
|
||||
Forward Iterator which is allowed on std::Forward Iterator is
|
||||
<tt>&*it</tt>. I think that <tt>&*</tt> is rarely needed in generic code.
|
||||
<p>Other translations are:<br>
|
||||
std::Forward Iterator -> ForwardIterator & Lvalue Iterator<br>
|
||||
std::Bidirectionnal Iterator -> Bidirectionnal Iterator & Lvalue
|
||||
Iterator<br>
|
||||
std::Random Access Iterator -> Random Access Iterator & Lvalue
|
||||
Iterator<br></p>
|
||||
|
||||
<p>
|
||||
reply by Jeremy Siek:
|
||||
<p>Note that in practice the only operation not allowed on my Forward
|
||||
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>
|
||||
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>reply by Jeremy Siek:</p>
|
||||
|
||||
<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>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<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,33 +1,37 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<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>
|
||||
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
|
||||
<img src="../../boost.png" alt="boost.png (6897 bytes)" align="center" width="277" height="86">
|
||||
<img src="../../boost.png" alt="boost.png (6897 bytes)" align="middle"
|
||||
width="277" height="86">
|
||||
|
||||
<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.
|
||||
<h1>Generator Iterator Adaptor</h1>
|
||||
|
||||
<h2>Synopsis</h2>
|
||||
<p>Defined in header <a href=
|
||||
"../../boost/generator_iterator.hpp">boost/generator_iterator.hpp</a></p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
<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.</p>
|
||||
|
||||
<h2>Synopsis</h2>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
namespace boost {
|
||||
template <class Generator>
|
||||
class generator_iterator_policies;
|
||||
@ -40,21 +44,19 @@ namespace boost {
|
||||
make_generator_iterator(Generator & gen);
|
||||
}
|
||||
</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
|
||||
is to construct a generator iterator type. The template parameter for
|
||||
this class is the Generator function object type that is being
|
||||
wrapped. The generator iterator adaptor only holds a reference (or
|
||||
pointer) to the function object, therefore the function object must
|
||||
outlive the generator iterator adaptor constructed from it.
|
||||
|
||||
<pre>
|
||||
template <class Generator>
|
||||
<p>The class generator_iterator_generator is a helper class whose purpose
|
||||
is to construct a generator iterator type. The template parameter for this
|
||||
class is the Generator function object type that is being wrapped. The
|
||||
generator iterator adaptor only holds a reference (or pointer) to the
|
||||
function object, therefore the function object must outlive the generator
|
||||
iterator adaptor constructed from it.</p>
|
||||
<pre>
|
||||
template <class Generator>
|
||||
class generator_iterator_generator
|
||||
{
|
||||
public:
|
||||
@ -62,65 +64,65 @@ public:
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3>Template Parameters</h3>
|
||||
|
||||
<h3>Template Parameters</h3>
|
||||
<table border summary="">
|
||||
<tr>
|
||||
<th>Parameter</th>
|
||||
|
||||
<table border>
|
||||
<tr>
|
||||
<th>Parameter</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt><a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a></tt>
|
||||
<td>The generator (0-ary function object) type being
|
||||
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>
|
||||
<tr>
|
||||
<td><tt><a href=
|
||||
"http://www.sgi.com/tech/stl/Generator.html">Generator</a></tt></td>
|
||||
|
||||
<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>.
|
||||
<td>The generator (0-ary function object) type being 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>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<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.
|
||||
<h3>Concept Model</h3>
|
||||
|
||||
<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>
|
||||
<h2><a name="make_generator_iterator">The Generator Iterator Object Generator</a></h2>
|
||||
<h3>Members</h3>
|
||||
|
||||
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>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>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
<h2><a name="make_generator_iterator" id="make_generator_iterator">The
|
||||
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>
|
||||
typename generator_iterator_generator<Generator>::type
|
||||
make_generator_iterator(Generator & gen);
|
||||
</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>
|
||||
|
||||
The following program shows how <code>generator_iterator</code>
|
||||
transforms a generator into an input iterator.
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
#include <iostream>
|
||||
#include <boost/generator_iterator.hpp>
|
||||
<blockquote>
|
||||
<pre>
|
||||
#include <iostream>
|
||||
#include <boost/generator_iterator.hpp>
|
||||
|
||||
class my_generator
|
||||
{
|
||||
@ -140,11 +142,22 @@ int main()
|
||||
std::cout << *it << std::endl;
|
||||
}
|
||||
</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>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user