Compare commits

...

14 Commits

Author SHA1 Message Date
nobody
9ff18c2c96 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Daniel Frey
d5ea07c737 Merged changes for ticket #979 from HEAD
[SVN r37920]
2007-06-06 20:57:40 +00:00
Fernando Cacciola
aa0096bf42 Testsuite for none_t added.
[SVN r37421]
2007-04-12 14:32:38 +00:00
Daniel James
005c2f3cc8 Fix a couple of links.
[SVN r36656]
2007-01-07 22:58:41 +00:00
Andreas Huber
09f7aab52d Merged L & C issue fixes & HTML conversions from trunk to branch.
[SVN r36281]
2006-12-05 22:33:21 +00:00
Peter Dimov
30a40f9f76 Linked to current_function.html
[SVN r36268]
2006-12-04 20:31:38 +00:00
Vladimir Prus
d9f8bae673 Merge from HEAD.
Allow building of shared versions of some Boost.Test libraries.
Adjust tests to use always use static linking to Boost.Test, since
linking to the shared version requires test changes.

Patch from Juergen Hunold.


[SVN r35990]
2006-11-10 19:59:52 +00:00
Peter Dimov
3c7b409460 License/copyright edits
[SVN r35958]
2006-11-09 20:34:33 +00:00
Beman Dawes
ee3551e8dc Merged copyright and license addition
[SVN r35907]
2006-11-07 19:27:00 +00:00
Rene Rivera
95da2e90de Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
John Maddock
6dd93ab916 Removed unneeded semicolon.
[SVN r35636]
2006-10-16 18:01:40 +00:00
Hartmut Kaiser
505d419a1b Resolved an ambiguity.
[SVN r35039]
2006-09-08 00:16:31 +00:00
Gennaro Prota
d968b5f5b9 boost guidelines (mainly from inspect tool: tabs, license reference text, etc.); more to do...
[SVN r34753]
2006-07-27 11:48:49 +00:00
nobody
d809d4e832 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
19 changed files with 1222 additions and 1401 deletions

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -48,9 +48,8 @@ void assertion_failed(char const * expr, char const * function, char const * fil
can be included multiple times in a single translation unit. <STRONG>BOOST_ASSERT</STRONG> can be included multiple times in a single translation unit. <STRONG>BOOST_ASSERT</STRONG>
will be redefined each time as specified above.</P> will be redefined each time as specified above.</P>
<p><br> <p><br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and <small>Copyright <20> 2002 by Peter Dimov. Distributed under the Boost Software License, Version
distribute this document is granted provided this copyright notice appears in 1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
all copies. This document is provided "as is" without express or implied copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
warranty, and with no claim as to its suitability for any purpose.</small></p>
</body> </body>
</html> </html>

View File

@@ -606,7 +606,7 @@ template &lt;bool opt&gt;
struct filler struct filler
{ {
template &lt;typename I, typename T&gt; template &lt;typename I, typename T&gt;
static void do_fill(I first, I last, typename boost::call_traits&lt;T&gt;::param_type val); static void do_fill(I first, I last, typename boost::call_traits&lt;T&gt;::param_type val)
{ {
while(first != last) while(first != last)
{ {
@@ -762,3 +762,4 @@ href="http://www.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</a>.
<p>&nbsp;</p> <p>&nbsp;</p>
</body> </body>
</html> </html>

View File

@@ -115,9 +115,8 @@ template&lt;class T&gt; struct checked_array_deleter
</p> </p>
<p> <p>
<br> <br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and <small>Copyright <20> 2002 by Peter Dimov. Distributed under the Boost Software License, Version
distribute this document is granted provided this copyright notice appears in 1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
all copies. This document is provided "as is" without express or implied copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
warranty, and with no claim as to its suitability for any purpose.</small></p>
</body> </body>
</html> </html>

View File

@@ -29,9 +29,8 @@
function. On such compilers, the string literal has an unspecified value.</p> function. On such compilers, the string literal has an unspecified value.</p>
<p> <p>
<br> <br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and <small>Copyright <20> 2002 by Peter Dimov. Distributed under the Boost Software License, Version
distribute this document is granted provided this copyright notice appears in 1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
all copies. This document is provided "as is" without express or implied copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
warranty, and with no claim as to its suitability for any purpose.</small></p>
</body> </body>
</html> </html>

View File

@@ -1,33 +0,0 @@
# Copyright David Abrahams 2003.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# For more information, see http://www.boost.org/
subproject libs/utility/enable_if/test ;
# bring in rules for testing
import testing ;
# Make tests run by default.
DEPENDS all : test ;
{
local test_monitor = <lib>@boost/libs/test/build/boost_test_exec_monitor ;
# look in BOOST_ROOT for sources first, just in this Jamfile
local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
test-suite utility/enable_if
:
[ run libs/utility/enable_if/test/constructors.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/dummy_arg_disambiguation.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/lazy.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/lazy_test.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/member_templates.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/namespace_disambiguation.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/no_disambiguation.cpp $(test_monitor) ]
[ run libs/utility/enable_if/test/partial_specializations.cpp $(test_monitor) ]
;
}

View File

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

View File

@@ -8,6 +8,8 @@
// See http://www.boost.org/libs/utility/operators.htm for documentation. // See http://www.boost.org/libs/utility/operators.htm for documentation.
// Revision History // Revision History
// 24 May 07 Changed empty_base to depend on T, see
// http://svn.boost.org/trac/boost/ticket/979
// 21 Oct 02 Modified implementation of operators to allow compilers with a // 21 Oct 02 Modified implementation of operators to allow compilers with a
// correct named return value optimization (NRVO) to produce optimal // correct named return value optimization (NRVO) to produce optimal
// code. (Daniel Frey) // code. (Daniel Frey)
@@ -90,15 +92,15 @@
namespace boost { namespace boost {
namespace detail { namespace detail {
template <typename T> class empty_base {
// Helmut Zeisel, empty base class optimization bug with GCC 3.0.0 // Helmut Zeisel, empty base class optimization bug with GCC 3.0.0
#if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0 #if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0
class empty_base {
bool dummy; bool dummy;
};
#else
class empty_base {};
#endif #endif
};
} // namespace detail } // namespace detail
} // namespace boost } // namespace boost
@@ -119,7 +121,7 @@ namespace boost
// Note that friend functions defined in a class are implicitly inline. // Note that friend functions defined in a class are implicitly inline.
// See the C++ std, 11.4 [class.friend] paragraph 5 // See the C++ std, 11.4 [class.friend] paragraph 5
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct less_than_comparable2 : B struct less_than_comparable2 : B
{ {
friend bool operator<=(const T& x, const U& y) { return !(x > y); } friend bool operator<=(const T& x, const U& y) { return !(x > y); }
@@ -130,7 +132,7 @@ struct less_than_comparable2 : B
friend bool operator>=(const U& x, const T& y) { return !(y > x); } friend bool operator>=(const U& x, const T& y) { return !(y > x); }
}; };
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct less_than_comparable1 : B struct less_than_comparable1 : B
{ {
friend bool operator>(const T& x, const T& y) { return y < x; } friend bool operator>(const T& x, const T& y) { return y < x; }
@@ -138,7 +140,7 @@ struct less_than_comparable1 : B
friend bool operator>=(const T& x, const T& y) { return !(x < y); } friend bool operator>=(const T& x, const T& y) { return !(x < y); }
}; };
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct equality_comparable2 : B struct equality_comparable2 : B
{ {
friend bool operator==(const U& y, const T& x) { return x == y; } friend bool operator==(const U& y, const T& x) { return x == y; }
@@ -146,7 +148,7 @@ struct equality_comparable2 : B
friend bool operator!=(const T& y, const U& x) { return !(y == x); } friend bool operator!=(const T& y, const U& x) { return !(y == x); }
}; };
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct equality_comparable1 : B struct equality_comparable1 : B
{ {
friend bool operator!=(const T& x, const T& y) { return !(x == y); } friend bool operator!=(const T& x, const T& y) { return !(x == y); }
@@ -165,7 +167,7 @@ struct equality_comparable1 : B
// implementation available. // implementation available.
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( const T& lhs, const U& rhs ) \ friend T operator OP( const T& lhs, const U& rhs ) \
@@ -174,7 +176,7 @@ struct NAME##2 : B \
{ T nrv( rhs ); nrv OP##= lhs; return nrv; } \ { T nrv( rhs ); nrv OP##= lhs; return nrv; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( const T& lhs, const T& rhs ) \ friend T operator OP( const T& lhs, const T& rhs ) \
@@ -182,21 +184,21 @@ struct NAME##1 : B \
}; };
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( const T& lhs, const U& rhs ) \ friend T operator OP( const T& lhs, const U& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \ }; \
\ \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct BOOST_OPERATOR2_LEFT(NAME) : B \ struct BOOST_OPERATOR2_LEFT(NAME) : B \
{ \ { \
friend T operator OP( const U& lhs, const T& rhs ) \ friend T operator OP( const U& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( const T& lhs, const T& rhs ) \ friend T operator OP( const T& lhs, const T& rhs ) \
@@ -211,34 +213,34 @@ struct NAME##1 : B \
// optimization opportunities to the compiler :) // optimization opportunities to the compiler :)
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \ #define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \ friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
}; };
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \ #define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
}; \ }; \
\ \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct BOOST_OPERATOR2_LEFT(NAME) : B \ struct BOOST_OPERATOR2_LEFT(NAME) : B \
{ \ { \
friend T operator OP( const U& lhs, const T& rhs ) \ friend T operator OP( const U& lhs, const T& rhs ) \
{ return T( lhs ) OP##= rhs; } \ { return T( lhs ) OP##= rhs; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
@@ -261,7 +263,7 @@ BOOST_BINARY_OPERATOR_COMMUTATIVE( orable, | )
// incrementable and decrementable contributed by Jeremy Siek // incrementable and decrementable contributed by Jeremy Siek
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct incrementable : B struct incrementable : B
{ {
friend T operator++(T& x, int) friend T operator++(T& x, int)
@@ -274,7 +276,7 @@ private: // The use of this typedef works around a Borland bug
typedef T incrementable_type; typedef T incrementable_type;
}; };
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct decrementable : B struct decrementable : B
{ {
friend T operator--(T& x, int) friend T operator--(T& x, int)
@@ -289,7 +291,7 @@ private: // The use of this typedef works around a Borland bug
// Iterator operator classes (contributed by Jeremy Siek) ------------------// // Iterator operator classes (contributed by Jeremy Siek) ------------------//
template <class T, class P, class B = ::boost::detail::empty_base> template <class T, class P, class B = ::boost::detail::empty_base<T> >
struct dereferenceable : B struct dereferenceable : B
{ {
P operator->() const P operator->() const
@@ -298,7 +300,7 @@ struct dereferenceable : B
} }
}; };
template <class T, class I, class R, class B = ::boost::detail::empty_base> template <class T, class I, class R, class B = ::boost::detail::empty_base<T> >
struct indexable : B struct indexable : B
{ {
R operator[](I n) const R operator[](I n) const
@@ -313,14 +315,14 @@ struct indexable : B
#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
#define BOOST_BINARY_OPERATOR( NAME, OP ) \ #define BOOST_BINARY_OPERATOR( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( const T& lhs, const U& rhs ) \ friend T operator OP( const T& lhs, const U& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( const T& lhs, const T& rhs ) \ friend T operator OP( const T& lhs, const T& rhs ) \
@@ -330,13 +332,13 @@ struct NAME##1 : B \
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS) #else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
#define BOOST_BINARY_OPERATOR( NAME, OP ) \ #define BOOST_BINARY_OPERATOR( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \ struct NAME##2 : B \
{ \ { \
friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
}; \ }; \
\ \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \ struct NAME##1 : B \
{ \ { \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
@@ -349,7 +351,7 @@ BOOST_BINARY_OPERATOR( right_shiftable, >> )
#undef BOOST_BINARY_OPERATOR #undef BOOST_BINARY_OPERATOR
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct equivalent2 : B struct equivalent2 : B
{ {
friend bool operator==(const T& x, const U& y) friend bool operator==(const T& x, const U& y)
@@ -358,7 +360,7 @@ struct equivalent2 : B
} }
}; };
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct equivalent1 : B struct equivalent1 : B
{ {
friend bool operator==(const T&x, const T&y) friend bool operator==(const T&x, const T&y)
@@ -367,7 +369,7 @@ struct equivalent1 : B
} }
}; };
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct partially_ordered2 : B struct partially_ordered2 : B
{ {
friend bool operator<=(const T& x, const U& y) friend bool operator<=(const T& x, const U& y)
@@ -384,7 +386,7 @@ struct partially_ordered2 : B
{ return (y < x) || (y == x); } { return (y < x) || (y == x); }
}; };
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct partially_ordered1 : B struct partially_ordered1 : B
{ {
friend bool operator>(const T& x, const T& y) friend bool operator>(const T& x, const T& y)
@@ -397,161 +399,161 @@ struct partially_ordered1 : B
// Combined operator classes (contributed by Daryle Walker) ----------------// // Combined operator classes (contributed by Daryle Walker) ----------------//
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct totally_ordered2 struct totally_ordered2
: less_than_comparable2<T, U : less_than_comparable2<T, U
, equality_comparable2<T, U, B , equality_comparable2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct totally_ordered1 struct totally_ordered1
: less_than_comparable1<T : less_than_comparable1<T
, equality_comparable1<T, B , equality_comparable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct additive2 struct additive2
: addable2<T, U : addable2<T, U
, subtractable2<T, U, B , subtractable2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct additive1 struct additive1
: addable1<T : addable1<T
, subtractable1<T, B , subtractable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct multiplicative2 struct multiplicative2
: multipliable2<T, U : multipliable2<T, U
, dividable2<T, U, B , dividable2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct multiplicative1 struct multiplicative1
: multipliable1<T : multipliable1<T
, dividable1<T, B , dividable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct integer_multiplicative2 struct integer_multiplicative2
: multiplicative2<T, U : multiplicative2<T, U
, modable2<T, U, B , modable2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct integer_multiplicative1 struct integer_multiplicative1
: multiplicative1<T : multiplicative1<T
, modable1<T, B , modable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct arithmetic2 struct arithmetic2
: additive2<T, U : additive2<T, U
, multiplicative2<T, U, B , multiplicative2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct arithmetic1 struct arithmetic1
: additive1<T : additive1<T
, multiplicative1<T, B , multiplicative1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct integer_arithmetic2 struct integer_arithmetic2
: additive2<T, U : additive2<T, U
, integer_multiplicative2<T, U, B , integer_multiplicative2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct integer_arithmetic1 struct integer_arithmetic1
: additive1<T : additive1<T
, integer_multiplicative1<T, B , integer_multiplicative1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct bitwise2 struct bitwise2
: xorable2<T, U : xorable2<T, U
, andable2<T, U , andable2<T, U
, orable2<T, U, B , orable2<T, U, B
> > > {}; > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct bitwise1 struct bitwise1
: xorable1<T : xorable1<T
, andable1<T , andable1<T
, orable1<T, B , orable1<T, B
> > > {}; > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct unit_steppable struct unit_steppable
: incrementable<T : incrementable<T
, decrementable<T, B , decrementable<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct shiftable2 struct shiftable2
: left_shiftable2<T, U : left_shiftable2<T, U
, right_shiftable2<T, U, B , right_shiftable2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct shiftable1 struct shiftable1
: left_shiftable1<T : left_shiftable1<T
, right_shiftable1<T, B , right_shiftable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct ring_operators2 struct ring_operators2
: additive2<T, U : additive2<T, U
, subtractable2_left<T, U , subtractable2_left<T, U
, multipliable2<T, U, B , multipliable2<T, U, B
> > > {}; > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct ring_operators1 struct ring_operators1
: additive1<T : additive1<T
, multipliable1<T, B , multipliable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct ordered_ring_operators2 struct ordered_ring_operators2
: ring_operators2<T, U : ring_operators2<T, U
, totally_ordered2<T, U, B , totally_ordered2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct ordered_ring_operators1 struct ordered_ring_operators1
: ring_operators1<T : ring_operators1<T
, totally_ordered1<T, B , totally_ordered1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct field_operators2 struct field_operators2
: ring_operators2<T, U : ring_operators2<T, U
, dividable2<T, U , dividable2<T, U
, dividable2_left<T, U, B , dividable2_left<T, U, B
> > > {}; > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct field_operators1 struct field_operators1
: ring_operators1<T : ring_operators1<T
, dividable1<T, B , dividable1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct ordered_field_operators2 struct ordered_field_operators2
: field_operators2<T, U : field_operators2<T, U
, totally_ordered2<T, U, B , totally_ordered2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct ordered_field_operators1 struct ordered_field_operators1
: field_operators1<T : field_operators1<T
, totally_ordered1<T, B , totally_ordered1<T, B
> > {}; > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct euclidian_ring_operators2 struct euclidian_ring_operators2
: ring_operators2<T, U : ring_operators2<T, U
, dividable2<T, U , dividable2<T, U
@@ -560,43 +562,43 @@ struct euclidian_ring_operators2
, modable2_left<T, U, B , modable2_left<T, U, B
> > > > > {}; > > > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct euclidian_ring_operators1 struct euclidian_ring_operators1
: ring_operators1<T : ring_operators1<T
, dividable1<T , dividable1<T
, modable1<T, B , modable1<T, B
> > > {}; > > > {};
template <class T, class U, class B = ::boost::detail::empty_base> template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct ordered_euclidian_ring_operators2 struct ordered_euclidian_ring_operators2
: totally_ordered2<T, U : totally_ordered2<T, U
, euclidian_ring_operators2<T, U, B , euclidian_ring_operators2<T, U, B
> > {}; > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct ordered_euclidian_ring_operators1 struct ordered_euclidian_ring_operators1
: totally_ordered1<T : totally_ordered1<T
, euclidian_ring_operators1<T, B , euclidian_ring_operators1<T, B
> > {}; > > {};
template <class T, class P, class B = ::boost::detail::empty_base> template <class T, class P, class B = ::boost::detail::empty_base<T> >
struct input_iteratable struct input_iteratable
: equality_comparable1<T : equality_comparable1<T
, incrementable<T , incrementable<T
, dereferenceable<T, P, B , dereferenceable<T, P, B
> > > {}; > > > {};
template <class T, class B = ::boost::detail::empty_base> template <class T, class B = ::boost::detail::empty_base<T> >
struct output_iteratable struct output_iteratable
: incrementable<T, B : incrementable<T, B
> {}; > {};
template <class T, class P, class B = ::boost::detail::empty_base> template <class T, class P, class B = ::boost::detail::empty_base<T> >
struct forward_iteratable struct forward_iteratable
: input_iteratable<T, P, B : input_iteratable<T, P, B
> {}; > {};
template <class T, class P, class B = ::boost::detail::empty_base> template <class T, class P, class B = ::boost::detail::empty_base<T> >
struct bidirectional_iteratable struct bidirectional_iteratable
: forward_iteratable<T, P : forward_iteratable<T, P
, decrementable<T, B , decrementable<T, B
@@ -606,7 +608,7 @@ struct bidirectional_iteratable
// which is an indirect base class of bidirectional_iterable, // which is an indirect base class of bidirectional_iterable,
// random_access_iteratable must not be derived from totally_ordered1 // random_access_iteratable must not be derived from totally_ordered1
// but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001) // but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001)
template <class T, class P, class D, class R, class B = ::boost::detail::empty_base> template <class T, class P, class D, class R, class B = ::boost::detail::empty_base<T> >
struct random_access_iteratable struct random_access_iteratable
: bidirectional_iteratable<T, P : bidirectional_iteratable<T, P
, less_than_comparable1<T , less_than_comparable1<T
@@ -651,19 +653,19 @@ struct random_access_iteratable
// Otherwise, because a Borland C++ 5.5 bug prevents a using declaration // Otherwise, because a Borland C++ 5.5 bug prevents a using declaration
// from working, we are forced to use inheritance for that compiler. // from working, we are forced to use inheritance for that compiler.
# define BOOST_IMPORT_TEMPLATE4(template_name) \ # define BOOST_IMPORT_TEMPLATE4(template_name) \
template <class T, class U, class V, class W, class B = ::boost::detail::empty_base> \ template <class T, class U, class V, class W, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, U, V, W, B> {}; struct template_name : ::template_name<T, U, V, W, B> {};
# define BOOST_IMPORT_TEMPLATE3(template_name) \ # define BOOST_IMPORT_TEMPLATE3(template_name) \
template <class T, class U, class V, class B = ::boost::detail::empty_base> \ template <class T, class U, class V, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, U, V, B> {}; struct template_name : ::template_name<T, U, V, B> {};
# define BOOST_IMPORT_TEMPLATE2(template_name) \ # define BOOST_IMPORT_TEMPLATE2(template_name) \
template <class T, class U, class B = ::boost::detail::empty_base> \ template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, U, B> {}; struct template_name : ::template_name<T, U, B> {};
# define BOOST_IMPORT_TEMPLATE1(template_name) \ # define BOOST_IMPORT_TEMPLATE1(template_name) \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, B> {}; struct template_name : ::template_name<T, B> {};
# endif // BOOST_NO_USING_TEMPLATE # endif // BOOST_NO_USING_TEMPLATE
@@ -752,7 +754,7 @@ template<class T> struct is_chained_base {
# define BOOST_OPERATOR_TEMPLATE(template_name) \ # define BOOST_OPERATOR_TEMPLATE(template_name) \
template <class T \ template <class T \
,class U = T \ ,class U = T \
,class B = ::boost::detail::empty_base \ ,class B = ::boost::detail::empty_base<T> \
,class O = typename is_chained_base<U>::value \ ,class O = typename is_chained_base<U>::value \
> \ > \
struct template_name : template_name##2<T, U, B> {}; \ struct template_name : template_name##2<T, U, B> {}; \
@@ -788,7 +790,7 @@ BOOST_OPERATOR_TEMPLATE1(template_name##1)
// In this case we can only assume that template_name<> is equivalent to the // In this case we can only assume that template_name<> is equivalent to the
// more commonly needed template_name1<> form. // more commonly needed template_name1<> form.
# define BOOST_OPERATOR_TEMPLATE(template_name) \ # define BOOST_OPERATOR_TEMPLATE(template_name) \
template <class T, class B = ::boost::detail::empty_base> \ template <class T, class B = ::boost::detail::empty_base<T> > \
struct template_name : template_name##1<T, B> {}; struct template_name : template_name##1<T, B> {};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

View File

@@ -1,4 +1,4 @@
// (C) 2002, Fernando Luis Cacciola Carballal. // Copyright 2002, Fernando Luis Cacciola Carballal.
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at
@@ -40,7 +40,7 @@ template<class T>
struct select_base struct select_base
{ {
typedef typename typedef typename
detail::if_true< ::boost::is_const<T>::value > boost::detail::if_true< ::boost::is_const<T>::value >
::template then< const_T_base<T>, non_const_T_base<T> >::type type ; ::template then< const_T_base<T>, non_const_T_base<T> >::type type ;
} ; } ;

View File

@@ -19,6 +19,7 @@
<a href="call_traits.htm">call_traits</a><br> <a href="call_traits.htm">call_traits</a><br>
<a href="checked_delete.html">checked_delete</a><br> <a href="checked_delete.html">checked_delete</a><br>
<a href="compressed_pair.htm">compressed_pair</a><br> <a href="compressed_pair.htm">compressed_pair</a><br>
<a href="current_function.html">current_function</a><br>
<a href="enable_if.html">enable_if</a><br> <a href="enable_if.html">enable_if</a><br>
<a href="iterator_adaptors.htm">iterator_adaptors</a><br> <a href="iterator_adaptors.htm">iterator_adaptors</a><br>
<a href="operators.htm">operators</a><br> <a href="operators.htm">operators</a><br>
@@ -27,8 +28,13 @@
<a href="value_init.htm">value_init</a></p> <a href="value_init.htm">value_init</a></p>
</blockquote> </blockquote>
<hr> <hr>
<p><EFBFBD> Copyright Beman Dawes, 2001</p>
<p>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">
www.boost.org/LICENSE_1_0.txt</a>)</p>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->01 September, 2003<!--webbot bot="Timestamp" endspan i-checksum="38582" --></p> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->07 November, 2006<!--webbot bot="Timestamp" endspan i-checksum="39368" --></p>
<p>&nbsp;</p>
</body> </body>
</html> </html>

View File

@@ -1,43 +0,0 @@
# Copyright David Abrahams 2003. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.
# For more information, see http://www.boost.org/
subproject libs/utility/test ;
# bring in rules for testing
import testing ;
# Make tests run by default.
DEPENDS all : test ;
local test_monitor = <lib>@boost/libs/test/build/boost_test_exec_monitor ;
# Please keep the tests ordered by filename
test-suite utility
:
[ run ../addressof_test.cpp ]
[ run ../assert_test.cpp ]
[ run ../base_from_member_test.cpp ]
[ run ../binary_search_test.cpp ]
[ run ../call_traits_test.cpp : -u ]
[ compile-fail ../checked_delete_test.cpp ]
[ run ../compressed_pair_test.cpp $(test_monitor) : -u ]
[ run ../current_function_test.cpp : : : <test-info>always_show_run_output ]
[ run ../iterators_test.cpp $(test_monitor) ]
[ run next_prior_test.cpp $(test_monitor) ]
[ compile-fail ../noncopyable_test.cpp ]
[ run ../numeric_traits_test.cpp ]
[ run ../operators_test.cpp $(test_monitor) ]
[ compile ../ref_ct_test.cpp ]
[ run ../ref_test.cpp $(test_monitor) ]
[ compile result_of_test.cpp ]
[ run ../shared_iterator_test.cpp ]
[ run ../value_init_test.cpp ]
[ compile-fail ../value_init_test_fail1.cpp ]
[ compile-fail ../value_init_test_fail2.cpp ]
[ compile-fail ../value_init_test_fail3.cpp ]
;

View File

@@ -18,19 +18,20 @@ test-suite utility
[ run ../binary_search_test.cpp ] [ run ../binary_search_test.cpp ]
[ run ../call_traits_test.cpp : -u ] [ run ../call_traits_test.cpp : -u ]
[ compile-fail ../checked_delete_test.cpp ] [ compile-fail ../checked_delete_test.cpp ]
[ run ../compressed_pair_test.cpp ../../test/build//boost_test_exec_monitor : -u ] [ run ../compressed_pair_test.cpp ../../test/build//boost_test_exec_monitor/<link>static : -u ]
[ run ../current_function_test.cpp : : : <test-info>always_show_run_output ] [ run ../current_function_test.cpp : : : <test-info>always_show_run_output ]
[ run ../iterators_test.cpp ../../test/build//boost_test_exec_monitor ] [ run ../iterators_test.cpp ../../test/build//boost_test_exec_monitor/<link>static ]
[ run next_prior_test.cpp ../../test/build//boost_test_exec_monitor ] [ run next_prior_test.cpp ../../test/build//boost_test_exec_monitor/<link>static ]
[ compile-fail ../noncopyable_test.cpp ] [ compile-fail ../noncopyable_test.cpp ]
[ run ../numeric_traits_test.cpp ] [ run ../numeric_traits_test.cpp ]
[ run ../operators_test.cpp ../../test/build//boost_test_exec_monitor ] [ run ../operators_test.cpp ../../test/build//boost_test_exec_monitor/<link>static ]
[ compile ../ref_ct_test.cpp ] [ compile ../ref_ct_test.cpp ]
[ run ../ref_test.cpp ../../test/build//boost_test_exec_monitor ] [ run ../ref_test.cpp ../../test/build//boost_test_exec_monitor/<link>static ]
[ compile result_of_test.cpp ] [ compile result_of_test.cpp ]
[ run ../shared_iterator_test.cpp ] [ run ../shared_iterator_test.cpp ]
[ run ../value_init_test.cpp ] [ run ../value_init_test.cpp ]
[ compile-fail ../value_init_test_fail1.cpp ] [ compile-fail ../value_init_test_fail1.cpp ]
[ compile-fail ../value_init_test_fail2.cpp ] [ compile-fail ../value_init_test_fail2.cpp ]
[ compile-fail ../value_init_test_fail3.cpp ] [ compile-fail ../value_init_test_fail3.cpp ]
[ run none_test.cpp ]
; ;

22
test/none_test.cpp Normal file
View File

@@ -0,0 +1,22 @@
// Copyright 2007 Fernando Luis Cacciola Carballal. Use, modification, and distribution
// are subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or a copy at
// http://www.boost.org/LICENSE_1_0.txt.)
// See http://www.boost.org/libs/utility for documentation.
// Boost test program for noost::none_t and boost::none
// Test strategy contributed by Richard Smith
#include <boost/optional/optional.hpp> // Test none.hpp is included with <optional.hpp>
// Left undefined to cause a linker error if this overload is incorrectly selected.
void verify_no_implicit_conversion_to_int ( int i ) ;
void verify_no_implicit_conversion_to_int ( boost::optional<int> const& ) {}
int main()
{
verify_no_implicit_conversion_to_int( boost::none );
}

View File

@@ -51,9 +51,8 @@ template&lt;class E&gt; void throw_exception(E const &amp; e)
} }
</pre> </pre>
<p><br> <p><br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and <small>Copyright <20> 2002 by Peter Dimov. Distributed under the Boost Software License, Version
distribute this document is granted provided this copyright notice appears in 1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
all copies. This document is provided "as is" without express or implied copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
warranty, and with no claim as to its suitability for any purpose.</small></p>
</body> </body>
</html> </html>

View File

@@ -23,6 +23,7 @@
<li> <li>
Function template <a href="#addressof">addressof()</a></li> Function template <a href="#addressof">addressof()</a></li>
<li>Class template <a href="#result_of">result_of</a></li> <li>Class template <a href="#result_of">result_of</a></li>
<li><a href="index.html">Other utilities not part of <code>utility.hpp</code></a></li>
</ul> </ul>
<h2> <h2>
Function templates <a name="checked_delete">checked_delete</a>() and Function templates <a name="checked_delete">checked_delete</a>() and