Compare commits

...

27 Commits

Author SHA1 Message Date
23474785ff + creating a branch for a xpressive extension that allows nesting
of regular expressions


[SVN r38759]
2007-08-19 15:07:44 +00:00
3f72b10182 Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
71cb8cb574 broken msvc name look-up getting confused about which detail namespace
[SVN r38511]
2007-08-08 18:05:24 +00:00
c950825ef4 - overloads apply for array construction
- adds support for zero arguments
- lets apply return the result of the new-expression
- revises the preprocessing code


[SVN r38101]
2007-06-26 23:07:25 +00:00
66ca84a45d Update result_of information
[SVN r38024]
2007-06-18 12:48:37 +00:00
06404f7d39 Improved empty_base
[SVN r37754]
2007-05-23 22:48:42 +00:00
2d860e2574 Fix result_of's handling of F(void).
[SVN r37140]
2007-03-05 15:25:16 +00:00
66514f61ff fix result_of ambiguity error for nullary functions
[SVN r36773]
2007-01-24 06:44:20 +00:00
63cde4d3fd slightly modified implementation works around msvc 7.1/8.0 compiler bugs
[SVN r36668]
2007-01-08 20:38:51 +00:00
1950f292df Merge fixed links from RC_1_34_0.
[SVN r36660]
2007-01-07 23:50:56 +00:00
92a0602190 Fixed license & copyright issues and converted to HTML 4.01
[SVN r36280]
2006-12-05 21:11:21 +00:00
c9a3ab1d04 Linked to current_function.html
[SVN r36268]
2006-12-04 20:31:38 +00:00
0782034333 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 r35989]
2006-11-10 19:09:56 +00:00
0808883f3c License/copyright edits
[SVN r35958]
2006-11-09 20:34:33 +00:00
2f69501e55 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
5b83f641a8 Removed unneeded semicolon.
[SVN r35636]
2006-10-16 18:01:40 +00:00
c730ab4ffb Parameter library Workarounds for Borland and MSVC
Parameter library explicit markup for expected failures

value_init.hpp:
  Borland workarounds
  Use angle-includes consistently


[SVN r35084]
2006-09-13 03:00:18 +00:00
e55610a0d0 Some additional functions added to optional (being new there won't be regressions)
[SVN r34411]
2006-06-26 18:01:38 +00:00
bf968794c9 Fixed an ambiguity.
[SVN r34403]
2006-06-26 01:58:38 +00:00
ce6e9c6698 Digital Mars support (Pavel Vozenilek)
[SVN r34373]
2006-06-22 12:47:19 +00:00
7ac180ed54 Use forwarding to get SFINAE effect in some common use cases.
Rename detail::result_of to detail::result_of_impl to avoid surprises
when result_of is used from within boost::detail.


[SVN r33981]
2006-05-16 22:55:27 +00:00
271ea9e901 Borland 5.81 fix (Alisdair Meredith)
[SVN r33161]
2006-02-27 21:57:38 +00:00
7cd572a326 VC++ warning suppression
[SVN r33001]
2006-02-18 23:03:14 +00:00
90c56ba2ce Update for BCB2006
[SVN r32865]
2006-02-12 20:16:31 +00:00
a5439500f5 Remove dead code, use Boost.Test rather than asserts.
[SVN r32861]
2006-02-12 18:58:08 +00:00
c0f0a4f51d Try again with DMC patch: last attempt broke Borland C++ Builder, so use implicit casts with protected rather than private bases.
[SVN r32524]
2006-02-03 11:00:23 +00:00
7594e00460 Added explicit static_casts when casting *this to a reference-to-base-class: it keeps Digital Mars happy apparently.
[SVN r32413]
2006-01-25 10:45:26 +00:00
31 changed files with 1475 additions and 1600 deletions

View File

@ -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&amp;</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 &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>
<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&amp;</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 &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,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>
&nbsp;
</TD>
</TR>
</td>
<TR>
<TD VAlign=top>
Address Operator
</TD>
<TD VAlign=top>
<pre>
<td valign="top"><tt>T</tt></td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">Address Operator</td>
<td valign="top">
<pre>
&amp;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>
&amp;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 &lt;class T&gt;
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 &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>
<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 &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
--
-- 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&lt;</tt>, and
<tt>operator&lt;</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 &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>
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>
is a <i>strict weak ordering</i>.
<P>
If <tt>operator&lt;</tt> is a strict weak ordering, and if each equivalence class
has only a single element, then <tt>operator&lt;</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 &lt; y</tt>
</TD>
<TD VAlign=top>
&nbsp;
</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 &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>
<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>Complexity guarantees</h3>
<h3>Invariants</h3>
<Table border>
<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="#2">[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="#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&lt;</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&lt;</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 &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>
<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 &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> 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>
is a <i>strict weak ordering</i>.</p>
<p>If <tt>operator&lt;</tt> is a strict weak ordering, and if each
equivalence class has only a single element, then <tt>operator&lt;</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 &lt; y</tt></td>
<td valign="top">&nbsp;</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 &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>
</tr>
</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>
<ul>
<li>int</li>
</ul>
<h3>Notes</h3>
<p><a name="n1" id="n1">[1]</a> Only <tt>operator&lt;</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&lt;</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 &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>
<!--
-- 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&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>.
<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&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>
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 -&gt; ForwardIterator &amp; Lvalue Iterator<br>
std::Bidirectionnal Iterator -&gt; Bidirectionnal Iterator &amp; Lvalue
Iterator<br>
std::Random Access Iterator -&gt; Random Access Iterator &amp; 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>&amp;*it</tt>. I
think that <tt>&amp;*</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 &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>
<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 &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>
will be redefined each time as specified above.</P>
<p><br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.</small></p>
<small>Copyright <20> 2002 by Peter Dimov. 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>.</small></p>
</body>
</html>

View File

@ -606,7 +606,7 @@ template &lt;bool opt&gt;
struct filler
{
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)
{
@ -762,3 +762,4 @@ href="http://www.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</a>.
<p>&nbsp;</p>
</body>
</html>

View File

@ -12,7 +12,6 @@
// 03 Oct 2000:
// Enabled extra tests for VC6.
#include <cassert>
#include <iostream>
#include <iomanip>
#include <algorithm>
@ -22,40 +21,6 @@
#include <libs/type_traits/test/test.hpp>
#include <libs/type_traits/test/check_type.hpp>
//
// define tests here
unsigned failures = 0;
unsigned test_count = 0;
//
// This must get defined within the test file.
// All compilers have bugs, set this to the number of
// regressions *expected* from a given compiler,
// if there are no workarounds for the bugs, *and*
// the regressions have been investigated.
//
extern unsigned int expected_failures;
//
// proc check_result()
// Checks that there were no regressions:
//
int check_result(int argc, char** argv)
{
std::cout << test_count << " tests completed, "
<< failures << " failures found, "
<< expected_failures << " failures expected from this compiler." << std::endl;
if((argc == 2)
&& (argv[1][0] == '-')
&& (argv[1][1] == 'a')
&& (argv[1][2] == 0))
{
std::cout << "Press any key to continue...";
std::cin.get();
}
return (failures == expected_failures)
? 0
: (failures != 0) ? static_cast<int>(failures) : -1;
}
// a way prevent warnings for unused variables
template<class T> inline void unused_variable(const T&) {}
@ -156,9 +121,9 @@ void call_traits_checker<T>::operator()(param_type p)
T t(p);
contained<T> c(t);
cout << "checking contained<" << typeid(T).name() << ">..." << endl;
assert(t == c.value());
assert(t == c.get());
assert(t == c.const_get());
BOOST_CHECK(t == c.value());
BOOST_CHECK(t == c.get());
BOOST_CHECK(t == c.const_get());
#ifndef __ICL
//cout << "typeof contained<" << typeid(T).name() << ">::v_ is: " << typeid(&contained<T>::v_).name() << endl;
cout << "typeof contained<" << typeid(T).name() << ">::value() is: " << typeid(&contained<T>::value).name() << endl;
@ -180,11 +145,11 @@ struct call_traits_checker<T[N]>
cout << "checking contained<" << typeid(T[N]).name() << ">..." << endl;
unsigned int i = 0;
for(i = 0; i < N; ++i)
assert(t[i] == c.value()[i]);
BOOST_CHECK(t[i] == c.value()[i]);
for(i = 0; i < N; ++i)
assert(t[i] == c.get()[i]);
BOOST_CHECK(t[i] == c.get()[i]);
for(i = 0; i < N; ++i)
assert(t[i] == c.const_get()[i]);
BOOST_CHECK(t[i] == c.const_get()[i]);
cout << "typeof contained<" << typeid(T[N]).name() << ">::v_ is: " << typeid(&contained<T[N]>::v_).name() << endl;
cout << "typeof contained<" << typeid(T[N]).name() << ">::value is: " << typeid(&contained<T[N]>::value).name() << endl;
@ -202,7 +167,7 @@ template <class W, class U>
void check_wrap(const W& w, const U& u)
{
cout << "checking " << typeid(W).name() << "..." << endl;
assert(w.value() == u);
BOOST_CHECK(w.value() == u);
}
//
@ -213,8 +178,8 @@ template <class T, class U, class V>
void check_make_pair(T c, U u, V v)
{
cout << "checking std::pair<" << typeid(c.first).name() << ", " << typeid(c.second).name() << ">..." << endl;
assert(c.first == u);
assert(c.second == v);
BOOST_CHECK(c.first == u);
BOOST_CHECK(c.second == v);
cout << endl;
}
@ -290,8 +255,6 @@ int main(int argc, char *argv[ ])
BOOST_CHECK_TYPE(int&, boost::call_traits<cr_type>::param_type);
#else
std::cout << "Your compiler cannot instantiate call_traits<int&const>, skipping four tests (4 errors)" << std::endl;
failures += 4;
test_count += 4;
#endif
BOOST_CHECK_TYPE(const int&, boost::call_traits<const int&>::value_type);
BOOST_CHECK_TYPE(const int&, boost::call_traits<const int&>::reference);
@ -313,13 +276,9 @@ int main(int argc, char *argv[ ])
BOOST_CHECK_TYPE(const test_abc1&, boost::call_traits<test_abc1>::param_type);
#else
std::cout << "You're compiler does not support partial template specialiation, skipping 8 tests (8 errors)" << std::endl;
failures += 12;
test_count += 12;
#endif
#else
std::cout << "You're compiler does not support partial template specialiation, skipping 20 tests (20 errors)" << std::endl;
failures += 24;
test_count += 24;
#endif
// test with an incomplete type:
BOOST_CHECK_TYPE(incomplete_type, boost::call_traits<incomplete_type>::value_type);
@ -327,12 +286,12 @@ int main(int argc, char *argv[ ])
BOOST_CHECK_TYPE(const incomplete_type&, boost::call_traits<incomplete_type>::const_reference);
BOOST_CHECK_TYPE(const incomplete_type&, boost::call_traits<incomplete_type>::param_type);
return check_result(argc, argv);
return 0;
}
//
// define call_traits tests to check that the assertions in the docs do actually work
// this is an instantiate only set of tests:
// this is an compile-time only set of tests:
//
template <typename T, bool isarray = false>
struct call_traits_test
@ -444,23 +403,3 @@ template struct call_traits_test<int[2], true>;
#endif
#endif
#if defined(BOOST_MSVC) && _MSC_VER <= 1300
unsigned int expected_failures = 12;
#elif defined(__SUNPRO_CC)
#if(__SUNPRO_CC <= 0x520)
unsigned int expected_failures = 18;
#elif(__SUNPRO_CC < 0x530)
unsigned int expected_failures = 17;
#else
unsigned int expected_failures = 6;
#endif
#elif defined(__BORLANDC__)
unsigned int expected_failures = 2;
#elif (defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC__ == 3) && (__GNUC_MINOR__ < 1)))
unsigned int expected_failures = 4;
#elif defined(__HP_aCC)
unsigned int expected_failures = 24;
#else
unsigned int expected_failures = 0;
#endif

View File

@ -115,9 +115,8 @@ template&lt;class T&gt; struct checked_array_deleter
</p>
<p>
<br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.</small></p>
<small>Copyright <20> 2002 by Peter Dimov. 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>.</small></p>
</body>
</html>

View File

@ -29,9 +29,8 @@
function. On such compilers, the string literal has an unspecified value.</p>
<p>
<br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.</small></p>
<small>Copyright <20> 2002 by Peter Dimov. 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>.</small></p>
</body>
</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,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 &lt;class Generator&gt;
class generator_iterator_policies;
@ -40,21 +44,19 @@ namespace boost {
make_generator_iterator(Generator &amp; 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 &lt;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 &lt;class Generator&gt;
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 &lt;class Generator&gt;
typename generator_iterator_generator&lt;Generator&gt;::type
make_generator_iterator(Generator &amp; 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 &lt;iostream>
#include &lt;boost/generator_iterator.hpp>
<blockquote>
<pre>
#include &lt;iostream&gt;
#include &lt;boost/generator_iterator.hpp&gt;
class my_generator
{
@ -140,11 +142,22 @@ int main()
std::cout &lt;&lt; *it &lt;&lt; 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 &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>
</html>

View File

@ -3,9 +3,8 @@
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="stylesheet" TYPE="text/css" HREF="../../boost.css">
<TITLE>Header </TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>In_place_factory Documentation</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
@ -77,7 +76,7 @@ object is likely to be temporary and serve no purpose besides being the source</
</pre>
<p>A solution to this problem is to support direct construction of the contained
object right in the container's storage.<br>
In this shceme, the user supplies the arguments for the X constructor
In this scheme, the user supplies the arguments for the X constructor
directly to the container:</p>
<pre>struct C
{
@ -138,7 +137,7 @@ The following simplified example shows the basic idea. A complete example follow
void foo()
{
C c( in_place(123,"hello" ) ;
C c( in_place(123,"hello") ) ;
}
</pre>

View File

@ -32,6 +32,10 @@ inline void current_function_helper()
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
#elif defined(__DMC__) && (__DMC__ >= 0x810)
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
#elif defined(__FUNCSIG__)
# define BOOST_CURRENT_FUNCTION __FUNCSIG__

View File

@ -58,7 +58,7 @@ struct ct_imp<T, isp, true>
template <typename T, bool b1>
struct ct_imp<T, true, b1>
{
typedef T const param_type;
typedef const T param_type;
};
}
@ -92,7 +92,7 @@ struct call_traits<T&>
typedef T& param_type; // hh removed const
};
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x570 ) )
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 ) )
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
@ -121,6 +121,15 @@ struct call_traits<T&const volatile>
typedef const T& const_reference;
typedef T& param_type; // hh removed const
};
template <typename T>
struct call_traits< T * >
{
typedef T * value_type;
typedef T * & reference;
typedef T * const & const_reference;
typedef T * const param_type; // hh removed const
};
#endif
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
template <typename T, std::size_t N>

View File

@ -27,6 +27,10 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/call_traits.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable:4512)
#endif
namespace boost
{
@ -132,7 +136,7 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 1>
: private ::boost::remove_cv<T1>::type
: protected ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
@ -174,7 +178,7 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 2>
: private ::boost::remove_cv<T2>::type
: protected ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
@ -217,8 +221,8 @@ namespace details
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 3>
: private ::boost::remove_cv<T1>::type,
private ::boost::remove_cv<T2>::type
: protected ::boost::remove_cv<T1>::type,
protected ::boost::remove_cv<T2>::type
{
public:
typedef T1 first_type;
@ -253,11 +257,14 @@ namespace details
// JM
// 4 T1 == T2, T1 and T2 both empty
// Note does not actually store an instance of T2 at all -
// but reuses T1 base class for both first() and second().
// Originally this did not store an instance of T2 at all
// but that led to problems beause it meant &x.first() == &x.second()
// which is not true for any other kind of pair, so now we store an instance
// of T2 just in case the user is relying on first() and second() returning
// different objects (albeit both empty).
template <class T1, class T2>
class compressed_pair_imp<T1, T2, 4>
: private ::boost::remove_cv<T1>::type
: protected ::boost::remove_cv<T1>::type
{
public:
typedef T1 first_type;
@ -428,5 +435,9 @@ swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
} // boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP

View File

@ -8,6 +8,8 @@
// See http://www.boost.org/libs/utility/operators.htm for documentation.
// 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
// correct named return value optimization (NRVO) to produce optimal
// code. (Daniel Frey)
@ -90,15 +92,15 @@
namespace boost {
namespace detail {
template <typename T> class empty_base {
// Helmut Zeisel, empty base class optimization bug with GCC 3.0.0
#if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0
class empty_base {
bool dummy;
};
#else
class empty_base {};
#endif
};
} // namespace detail
} // namespace boost
@ -119,7 +121,7 @@ namespace boost
// Note that friend functions defined in a class are implicitly inline.
// 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
{
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); }
};
template <class T, class B = ::boost::detail::empty_base>
template <class T, class B = ::boost::detail::empty_base<T> >
struct less_than_comparable1 : B
{
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); }
};
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
{
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); }
};
template <class T, class B = ::boost::detail::empty_base>
template <class T, class B = ::boost::detail::empty_base<T> >
struct equality_comparable1 : B
{
friend bool operator!=(const T& x, const T& y) { return !(x == y); }
@ -165,7 +167,7 @@ struct equality_comparable1 : B
// implementation available.
#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 \
{ \
friend T operator OP( const T& lhs, const U& rhs ) \
@ -174,33 +176,33 @@ struct NAME##2 : B \
{ 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 \
{ \
friend T operator OP( const T& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
};
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \
struct NAME##2 : B \
{ \
friend T operator OP( const T& lhs, const U& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \
\
template <class T, class U, class B = ::boost::detail::empty_base> \
struct BOOST_OPERATOR2_LEFT(NAME) : B \
{ \
friend T operator OP( const U& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \
\
template <class T, class B = ::boost::detail::empty_base> \
struct NAME##1 : B \
{ \
friend T operator OP( const T& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \
{ \
friend T operator OP( const T& lhs, const U& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \
\
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct BOOST_OPERATOR2_LEFT(NAME) : B \
{ \
friend T operator OP( const U& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
}; \
\
template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \
{ \
friend T operator OP( const T& lhs, const T& rhs ) \
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
};
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
@ -210,35 +212,35 @@ struct NAME##1 : B \
// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
// optimization opportunities to the compiler :)
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \
struct NAME##2 : B \
{ \
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; } \
}; \
\
template <class T, class B = ::boost::detail::empty_base> \
struct NAME##1 : B \
{ \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct NAME##2 : B \
{ \
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; } \
}; \
\
template <class T, class B = ::boost::detail::empty_base<T> > \
struct NAME##1 : B \
{ \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
};
#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 \
{ \
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 \
{ \
friend T operator OP( const U& lhs, const T& 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 \
{ \
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
template <class T, class B = ::boost::detail::empty_base>
template <class T, class B = ::boost::detail::empty_base<T> >
struct incrementable : B
{
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;
};
template <class T, class B = ::boost::detail::empty_base>
template <class T, class B = ::boost::detail::empty_base<T> >
struct decrementable : B
{
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) ------------------//
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
{
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
{
R operator[](I n) const
@ -313,14 +315,14 @@ struct indexable : B
#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
#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 \
{ \
friend T operator OP( const T& lhs, const U& rhs ) \
{ 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 \
{ \
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)
#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 \
{ \
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 \
{ \
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
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
{
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
{
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
{
friend bool operator<=(const T& x, const U& y)
@ -384,7 +386,7 @@ struct partially_ordered2 : B
{ 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
{
friend bool operator>(const T& x, const T& y)
@ -397,161 +399,161 @@ struct partially_ordered1 : B
// 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
: less_than_comparable2<T, U
, 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
: less_than_comparable1<T
, 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
: addable2<T, U
, 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
: addable1<T
, 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
: multipliable2<T, U
, 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
: multipliable1<T
, 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
: multiplicative2<T, U
, 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
: multiplicative1<T
, 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
: additive2<T, U
, 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
: additive1<T
, 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
: additive2<T, U
, 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
: additive1<T
, 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
: xorable2<T, U
, andable2<T, U
, 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
: xorable1<T
, andable1<T
, 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
: incrementable<T
, 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
: left_shiftable2<T, U
, 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
: left_shiftable1<T
, 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
: additive2<T, U
, subtractable2_left<T, U
, 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
: additive1<T
, 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
: ring_operators2<T, U
, 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
: ring_operators1<T
, 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
: ring_operators2<T, U
, dividable2<T, U
, 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
: ring_operators1<T
, 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
: field_operators2<T, U
, 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
: field_operators1<T
, 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
: ring_operators2<T, U
, dividable2<T, U
@ -560,43 +562,43 @@ struct euclidian_ring_operators2
, 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
: ring_operators1<T
, dividable1<T
, 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
: totally_ordered2<T, U
, 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
: totally_ordered1<T
, 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
: equality_comparable1<T
, incrementable<T
, 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
: 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
: 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
: forward_iteratable<T, P
, decrementable<T, B
@ -606,7 +608,7 @@ struct bidirectional_iteratable
// which is an indirect base class of bidirectional_iterable,
// random_access_iteratable must not be derived from totally_ordered1
// 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
: bidirectional_iteratable<T, P
, less_than_comparable1<T
@ -650,20 +652,20 @@ struct random_access_iteratable
// Otherwise, because a Borland C++ 5.5 bug prevents a using declaration
// from working, we are forced to use inheritance for that compiler.
# define BOOST_IMPORT_TEMPLATE4(template_name) \
template <class T, class U, class V, class W, class B = ::boost::detail::empty_base> \
# define BOOST_IMPORT_TEMPLATE4(template_name) \
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> {};
# define BOOST_IMPORT_TEMPLATE3(template_name) \
template <class T, class U, class V, class B = ::boost::detail::empty_base> \
# define BOOST_IMPORT_TEMPLATE3(template_name) \
template <class T, class U, class V, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, U, V, B> {};
# define BOOST_IMPORT_TEMPLATE2(template_name) \
template <class T, class U, class B = ::boost::detail::empty_base> \
# define BOOST_IMPORT_TEMPLATE2(template_name) \
template <class T, class U, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, U, B> {};
# define BOOST_IMPORT_TEMPLATE1(template_name) \
template <class T, class B = ::boost::detail::empty_base> \
# define BOOST_IMPORT_TEMPLATE1(template_name) \
template <class T, class B = ::boost::detail::empty_base<T> > \
struct template_name : ::template_name<T, B> {};
# endif // BOOST_NO_USING_TEMPLATE
@ -752,7 +754,7 @@ template<class T> struct is_chained_base {
# define BOOST_OPERATOR_TEMPLATE(template_name) \
template <class 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 \
> \
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
// more commonly needed template_name1<> form.
# 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> {};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

View File

@ -10,6 +10,7 @@
#include <boost/config.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/detail/workaround.hpp>
//
// ref.hpp - ref/cref, useful helper functions
@ -33,7 +34,7 @@ template<class T> class reference_wrapper
public:
typedef T type;
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1300 )
explicit reference_wrapper(T& t): t_(&t) {}
@ -54,7 +55,7 @@ private:
T* t_;
};
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x570)
# if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
# define BOOST_REF_CONST
# else
# define BOOST_REF_CONST const

View File

@ -1,4 +1,5 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2007, Tobias Schwinger.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -9,25 +10,27 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_25AGO2003_HPP
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_25AGO2003_HPP
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
#include <new>
#include <cstddef>
#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT(z,n,_) BOOST_PP_CAT(m_a,n) BOOST_PP_LPAREN() BOOST_PP_CAT(a,n) BOOST_PP_RPAREN()
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL(z,n,_) BOOST_PP_CAT(A,n) const& BOOST_PP_CAT(m_a,n);
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG(z,n,_) BOOST_PP_CAT(m_a,n)
#define BOOST_MAX_INPLACE_FACTORY_ARITY 10
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
#endif

View File

@ -1,4 +1,5 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2007, Tobias Schwinger.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -9,15 +10,14 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT
#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL
#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG
#undef BOOST_MAX_INPLACE_FACTORY_ARITY
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_25AGO2003_HPP
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
#endif

View File

@ -21,66 +21,69 @@
template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<F(BOOST_RESULT_OF_ARGS)>
: detail::result_of<F, F(BOOST_RESULT_OF_ARGS)> {};
: boost::detail::result_of_impl<F, F(BOOST_RESULT_OF_ARGS), (boost::detail::has_result_type<F>::value)> {};
#endif
#undef BOOST_RESULT_OF_ARGS
#if BOOST_PP_ITERATION() >= 1
namespace detail {
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (*)(BOOST_RESULT_OF_ARGS), FArgs>
struct result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
{
typedef R type;
};
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (&)(BOOST_RESULT_OF_ARGS), FArgs>
struct result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
{
typedef R type;
};
#undef BOOST_RESULT_OF_ARGS
#if BOOST_PP_ITERATION() > 1 && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (T0::*)
struct result_of_impl<R (T0::*)
(BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)),
FArgs>
FArgs, false>
{
typedef R type;
};
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (T0::*)
struct result_of_impl<R (T0::*)
(BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
const,
FArgs>
FArgs, false>
{
typedef R type;
};
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (T0::*)
struct result_of_impl<R (T0::*)
(BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
volatile,
FArgs>
FArgs, false>
{
typedef R type;
};
template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
struct result_of<R (T0::*)
struct result_of_impl<R (T0::*)
(BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
const volatile,
FArgs>
FArgs, false>
{
typedef R type;
};
#endif
}
#endif

View File

@ -1,4 +1,5 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2007, Tobias Schwinger.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -9,50 +10,79 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP
#define BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP
#ifndef BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
#ifndef BOOST_PP_IS_ITERATING
#include <boost/utility/detail/in_place_factory_prefix.hpp>
#include <boost/type.hpp>
namespace boost {
class in_place_factory_base {} ;
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS(z,n,_) \
template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \
class BOOST_PP_CAT(in_place_factory, BOOST_PP_INC(n) ) : public in_place_factory_base \
{ \
public: \
\
BOOST_PP_CAT(in_place_factory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \
: \
BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \
{} \
\
template<class T> \
void apply ( void* address BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T) ) const \
{ \
new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \
} \
\
BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \
} ; \
\
template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \
BOOST_PP_CAT(in_place_factory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \
in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \
{ \
return BOOST_PP_CAT(in_place_factory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \
( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \
} ; \
BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() )
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY)
#define BOOST_PP_FILENAME_1 <boost/utility/in_place_factory.hpp>
#include BOOST_PP_ITERATE()
} // namespace boost
#include <boost/utility/detail/in_place_factory_suffix.hpp>
#define BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
#else
#define N BOOST_PP_ITERATION()
#if N
template< BOOST_PP_ENUM_PARAMS(N, class A) >
#endif
class BOOST_PP_CAT(in_place_factory,N)
:
public in_place_factory_base
{
public:
explicit BOOST_PP_CAT(in_place_factory,N)
( BOOST_PP_ENUM_BINARY_PARAMS(N,A,const& a) )
#if N > 0
: BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _)
#endif
{}
template<class T>
void* apply(void* address
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const
{
return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) );
}
template<class T>
void* apply(void* address, std::size_t n
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const
{
for(char* next = address = this->BOOST_NESTED_TEMPLATE apply<T>(address);
!! --n;)
this->BOOST_NESTED_TEMPLATE apply<T>(next = next+sizeof(T));
return address;
}
BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _)
};
#if N > 0
template< BOOST_PP_ENUM_PARAMS(N, class A) >
inline BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
{
return BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
( BOOST_PP_ENUM_PARAMS(N, a) );
}
#else
inline in_place_factory0 in_place()
{
return in_place_factory0();
}
#endif
#undef N
#endif
#endif

View File

@ -15,6 +15,8 @@
#include <boost/preprocessor.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#ifndef BOOST_RESULT_OF_NUM_ARGS
# define BOOST_RESULT_OF_NUM_ARGS 10
@ -29,28 +31,48 @@ namespace detail {
BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
template<typename F, typename FArgs, bool HasResultType> struct get_result_of;
template<typename F, typename FArgs>
struct get_result_of<F, FArgs, true>
{
typedef typename F::result_type type;
};
template<typename F, typename FArgs>
struct get_result_of<F, FArgs, false>
{
typedef typename F::template result<FArgs>::type type;
};
template<typename F, typename FArgs, bool HasResultType> struct result_of_impl;
template<typename F>
struct get_result_of<F, F(void), false>
struct result_of_void_impl
{
typedef void type;
};
template<typename R>
struct result_of_void_impl<R (*)(void)>
{
typedef R type;
};
template<typename R>
struct result_of_void_impl<R (&)(void)>
{
typedef R type;
};
template<typename F, typename FArgs>
struct result_of : get_result_of<F, FArgs, (has_result_type<F>::value)> {};
struct result_of_impl<F, FArgs, true>
{
typedef typename F::result_type type;
};
template<typename FArgs>
struct is_function_with_no_args : mpl::false_ {};
template<typename F>
struct is_function_with_no_args<F(void)> : mpl::true_ {};
template<typename F, typename FArgs>
struct result_of_nested_result : F::template result<FArgs>
{};
template<typename F, typename FArgs>
struct result_of_impl<F, FArgs, false>
: mpl::if_<is_function_with_no_args<FArgs>,
result_of_void_impl<F>,
result_of_nested_result<F, FArgs> >::type
{};
} // end namespace detail

View File

@ -1,4 +1,5 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2007, Tobias Schwinger.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -9,8 +10,8 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP
#define BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP
#ifndef BOOST_UTILITY_TYPED_INPLACE_FACTORY_04APR2007_HPP
#ifndef BOOST_PP_IS_ITERATING
#include <boost/utility/detail/in_place_factory_prefix.hpp>
@ -18,40 +19,59 @@ namespace boost {
class typed_in_place_factory_base {} ;
#define BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS(z,n,_) \
template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \
class BOOST_PP_CAT(typed_in_place_factory, BOOST_PP_INC(n) ) : public typed_in_place_factory_base \
{ \
public: \
\
typedef T value_type ; \
\
BOOST_PP_CAT(typed_in_place_factory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \
: \
BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \
{} \
\
void apply ( void* address ) const \
{ \
new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \
} \
\
BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \
} ; \
\
template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \
BOOST_PP_CAT(typed_in_place_factory, BOOST_PP_INC(n) ) < T , BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \
in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \
{ \
return BOOST_PP_CAT(typed_in_place_factory, BOOST_PP_INC(n) ) < T, BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \
( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \
} ; \
BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() )
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY)
#define BOOST_PP_FILENAME_1 <boost/utility/typed_in_place_factory.hpp>
#include BOOST_PP_ITERATE()
} // namespace boost
#include <boost/utility/detail/in_place_factory_suffix.hpp>
#define BOOST_UTILITY_TYPED_INPLACE_FACTORY_04APR2007_HPP
#else
#define N BOOST_PP_ITERATION()
template< class T BOOST_PP_ENUM_TRAILING_PARAMS(N,class A) >
class BOOST_PP_CAT(typed_in_place_factory,N)
:
public typed_in_place_factory_base
{
public:
typedef T value_type;
explicit BOOST_PP_CAT(typed_in_place_factory,N)
( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
#if N > 0
: BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _)
#endif
{}
void* apply (void* address) const
{
return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) );
}
void* apply (void* address, std::size_t n) const
{
for(char* next = address = this->apply(address); !! --n;)
this->apply(next = next+sizeof(T));
return address;
}
BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _)
};
template< class T BOOST_PP_ENUM_TRAILING_PARAMS(N, class A) >
inline BOOST_PP_CAT(typed_in_place_factory,N)<
T BOOST_PP_ENUM_TRAILING_PARAMS(N, A) >
in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
{
return BOOST_PP_CAT(typed_in_place_factory,N)<
T BOOST_PP_ENUM_TRAILING_PARAMS(N, A) >( BOOST_PP_ENUM_PARAMS(N, a) );
}
#undef N
#endif
#endif

View File

@ -9,8 +9,9 @@
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
#include "boost/detail/select_type.hpp"
#include "boost/type_traits/cv_traits.hpp"
#include <boost/detail/select_type.hpp>
#include <boost/type_traits/cv_traits.hpp>
#include <boost/detail/workaround.hpp>
namespace boost {
@ -39,8 +40,11 @@ struct non_const_T_base
template<class T>
struct select_base
{
typedef typename
detail::if_true< ::boost::is_const<T>::value >
typedef
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
typename
#endif
::boost::detail::if_true< ::boost::is_const<T>::value >
::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="checked_delete.html">checked_delete</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="iterator_adaptors.htm">iterator_adaptors</a><br>
<a href="operators.htm">operators</a><br>
@ -27,8 +28,13 @@
<a href="value_init.htm">value_init</a></p>
</blockquote>
<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
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->01 September, 2003<!--webbot bot="Timestamp" endspan i-checksum="38582" --></p>
<p>&nbsp;</p>
</body>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->07 November, 2006<!--webbot bot="Timestamp" endspan i-checksum="39368" --></p>
</body>
</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,15 +18,15 @@ test-suite utility
[ run ../binary_search_test.cpp ]
[ run ../call_traits_test.cpp : -u ]
[ 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 ../iterators_test.cpp ../../test/build//boost_test_exec_monitor ]
[ run next_prior_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/<link>static ]
[ compile-fail ../noncopyable_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 ]
[ 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 ]
[ run ../shared_iterator_test.cpp ]
[ run ../value_init_test.cpp ]

View File

@ -24,6 +24,24 @@ struct int_result_type_and_float_result_of
template<typename F> struct result { typedef float type; };
};
template<typename T>
struct int_result_type_template { typedef int result_type; };
template<typename T>
struct int_result_of_template
{
template<typename F> struct result;
template<typename This, typename That> struct result<This(That)> { typedef int type; };
};
template<typename T>
struct int_result_type_and_float_result_of_template
{
typedef int result_type;
template<typename F> struct result;
template<typename This, typename That> struct result<This(That)> { typedef float type; };
};
struct X {};
int main()
@ -32,10 +50,13 @@ int main()
typedef int (*func_ptr)(float, double);
typedef int (&func_ref)(float, double);
typedef int (*func_ptr_0)();
typedef int (&func_ref_0)();
typedef int (X::*mem_func_ptr)(float);
typedef int (X::*mem_func_ptr_c)(float) const;
typedef int (X::*mem_func_ptr_v)(float) volatile;
typedef int (X::*mem_func_ptr_cv)(float) const volatile;
typedef int (X::*mem_func_ptr_0)();
BOOST_STATIC_ASSERT((is_same<result_of<int_result_type(float)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(double)>::type, int>::value));
@ -43,11 +64,22 @@ int main()
BOOST_STATIC_ASSERT((is_same<result_of<const int_result_of(double)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, void>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of(char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_template<void>(float)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(double)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, void>::value));
BOOST_STATIC_ASSERT((is_same<result_of<const int_result_of_template<void>(double)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, void>::value));
BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_template<void>(char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(char, float)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<func_ref(char, float)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<func_ptr_0()>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<func_ref_0()>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr(X,char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_c(X,char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_v(X,char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_cv(X,char)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<mem_func_ptr_0(X)>::type, int>::value));
BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(void)>::type, int>::value));
return 0;
}

View File

@ -51,9 +51,8 @@ template&lt;class E&gt; void throw_exception(E const &amp; e)
}
</pre>
<p><br>
<small>Copyright <20> 2002 by Peter Dimov. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.</small></p>
<small>Copyright <20> 2002 by Peter Dimov. 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>.</small></p>
</body>
</html>

View File

@ -23,6 +23,7 @@
<li>
Function template <a href="#addressof">addressof()</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>
<h2>
Function templates <a name="checked_delete">checked_delete</a>() and
@ -162,9 +163,9 @@ void f() {
<code><em>N</em> &gt; 0</code> or <code>void</code>
when <code><em>N</em> = 0</code>. For additional
information about <code>result_of</code>, see the
current draft of the C++ Library TR, <a
href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2004/n1647.pdf">N1647</a>,
or the <code>result_of</code> <a
C++ Library Technical Report, <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">N1836</a>,
or, for motivation and design rationale, the <code>result_of</code> <a
href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1454.html">proposal</a>.</p>
<p>Class template <code>result_of</code> resides in