summaryrefslogtreecommitdiff
path: root/doc/html/function
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 12:57:26 -0700
commit1a78a62555be32868418fe52f8e330c9d0f95d5a (patch)
treed3765a80e7d3b9640ec2e930743630cd6b9fce2b /doc/html/function
downloadboost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'doc/html/function')
-rwxr-xr-xdoc/html/function/faq.html224
-rwxr-xr-xdoc/html/function/history.html151
-rwxr-xr-xdoc/html/function/misc.html111
-rwxr-xr-xdoc/html/function/reference.html175
-rwxr-xr-xdoc/html/function/testsuite.html199
-rwxr-xr-xdoc/html/function/tutorial.html390
6 files changed, 1250 insertions, 0 deletions
diff --git a/doc/html/function/faq.html b/doc/html/function/faq.html
new file mode 100755
index 0000000000..fdaf642394
--- /dev/null
+++ b/doc/html/function/faq.html
@@ -0,0 +1,224 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Frequently Asked Questions</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="../boost/function_equal.html" title="Function template function_equal">
+<link rel="next" href="misc.html" title="Miscellaneous Notes">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../boost/function_equal.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="misc.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.faq"></a>Frequently Asked Questions</h2></div></div></div>
+<div class="qandaset">
+<a name="id1549882"></a><dl>
+<dt>1. <a href="faq.html#id1549884">Why can't I compare
+ boost::function objects with
+ operator== or
+ operator!=?</a>
+</dt>
+<dt>2. <a href="faq.html#id1550238">I see void pointers; is this [mess] type safe?</a>
+</dt>
+<dt>3. <a href="faq.html#id1550258">Why are there workarounds for void returns? C++ allows them!</a>
+</dt>
+<dt>4. <a href="faq.html#id1550310">Why (function) cloning?</a>
+</dt>
+<dt>5. <a href="faq.html#id1550330">How much overhead does a call through boost::function incur?</a>
+</dt>
+</dl>
+<table border="0" width="100%" summary="Q and A Set">
+<col align="left" width="1%">
+<col>
+<tbody>
+<tr class="question">
+<td align="left" valign="top">
+<a name="id1549884"></a><a name="id1549886"></a><p><b>1.</b></p>
+</td>
+<td align="left" valign="top"><p>Why can't I compare
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> objects with
+ <code class="computeroutput">operator==</code> or
+ <code class="computeroutput">operator!=</code>?</p></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"></td>
+<td align="left" valign="top">
+<p>Comparison between <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>
+ objects cannot be implemented "well", and therefore will not be
+ implemented. The typical semantics requested for <code class="computeroutput">f ==
+ g</code> given <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> objects
+ <code class="computeroutput">f</code> and <code class="computeroutput">g</code> are:</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">If <code class="computeroutput">f</code> and <code class="computeroutput">g</code>
+ store function objects of the same type, use that type's
+ <code class="computeroutput">operator==</code> to compare
+ them.</li>
+<li class="listitem">If <code class="computeroutput">f</code> and <code class="computeroutput">g</code>
+ store function objects of different types, return
+ <code class="computeroutput">false</code>.</li>
+</ul></div>
+<p>The problem occurs when the type of the function objects
+ stored by both <code class="computeroutput">f</code> and <code class="computeroutput">g</code> doesn't have an
+ <code class="computeroutput">operator==</code>: we would like the expression <code class="computeroutput">f ==
+ g</code> to fail to compile, as occurs with, e.g., the standard
+ containers. However, this is not implementable for
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> because it necessarily
+ "erases" some type information after it has been assigned a
+ function object, so it cannot try to call
+ <code class="computeroutput">operator==</code> later: it must either find a way to call
+ <code class="computeroutput">operator==</code> now, or it will never be able to call it
+ later. Note, for instance, what happens if you try to put a
+ <code class="computeroutput">float</code> value into a
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> object: you will get an
+ error at the assignment operator or constructor, not in
+ <code class="computeroutput">operator()</code>, because the function-call expression
+ must be bound in the constructor or assignment operator.</p>
+<p>The most promising approach is to find a method of
+ determining if <code class="computeroutput">operator==</code> can be called for a
+ particular type, and then supporting it only when it is
+ available; in other situations, an exception would be
+ thrown. However, to date there is no known way to detect if an
+ arbitrary operator expression <code class="computeroutput">f == g</code> is suitably
+ defined. The best solution known has the following undesirable
+ qualities:</p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">Fails at compile-time for objects where
+ <code class="computeroutput">operator==</code> is not accessible (e.g., because it is
+ <code class="computeroutput">private</code>).</li>
+<li class="listitem">Fails at compile-time if calling
+ <code class="computeroutput">operator==</code> is ambiguous.</li>
+<li class="listitem">Appears to be correct if the
+ <code class="computeroutput">operator==</code> declaration is correct, even though
+ <code class="computeroutput">operator==</code> may not compile.</li>
+</ol></div>
+<p>All of these problems translate into failures in the
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> constructors or
+ assignment operator, <span class="emphasis"><em>even if the user never invokes
+ operator==</em></span>. We can't do that to users.</p>
+<p>The other option is to place the burden on users that want
+ to use <code class="computeroutput">operator==</code>, e.g., by providing an
+ <code class="computeroutput">is_equality_comparable</code> trait they may
+ specialize. This is a workable solution, but is dangerous in
+ practice, because forgetting to specialize the trait will result
+ in unexpected exceptions being thrown from
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>'s
+ <code class="computeroutput">operator==</code>. This essentially negates the usefulness
+ of <code class="computeroutput">operator==</code> in the context in which it is most
+ desired: multitarget callbacks. The
+ <a class="link" href="../signals.html" title="Chapter&#160;24.&#160;Boost.Signals">Signals</a> library has a way around
+ this.</p>
+</td>
+</tr>
+<tr class="question">
+<td align="left" valign="top">
+<a name="id1550238"></a><a name="id1550240"></a><p><b>2.</b></p>
+</td>
+<td align="left" valign="top"><p>I see void pointers; is this [mess] type safe?</p></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"></td>
+<td align="left" valign="top"><p>Yes, <code class="computeroutput">boost::function</code> is type
+safe even though it uses void pointers and pointers to functions
+returning void and taking no arguments. Essentially, all type
+information is encoded in the functions that manage and invoke
+function pointers and function objects. Only these functions are
+instantiated with the exact type that is pointed to by the void
+pointer or pointer to void function. The reason that both are required
+is that one may cast between void pointers and object pointers safely
+or between different types of function pointers (provided you don't
+invoke a function pointer with the wrong type). </p></td>
+</tr>
+<tr class="question">
+<td align="left" valign="top">
+<a name="id1550258"></a><a name="id1550261"></a><p><b>3.</b></p>
+</td>
+<td align="left" valign="top"><p>Why are there workarounds for void returns? C++ allows them!</p></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"></td>
+<td align="left" valign="top">
+<p>Void returns are permitted by the C++ standard, as in this code snippet:
+</p>
+<pre class="programlisting">void f();
+void g() { return f(); }</pre>
+<p>
+ </p>
+<p> This is a valid usage of <code class="computeroutput">boost::function</code> because void returns are not used. With void returns, we would attempting to compile ill-formed code similar to:
+</p>
+<pre class="programlisting">int f();
+void g() { return f(); }</pre>
+<p>
+</p>
+<p> In essence, not using void returns allows
+<code class="computeroutput">boost::function</code> to swallow a return value. This is
+consistent with allowing the user to assign and invoke functions and
+function objects with parameters that don't exactly match.</p>
+</td>
+</tr>
+<tr class="question">
+<td align="left" valign="top">
+<a name="id1550310"></a><a name="id1550312"></a><p><b>4.</b></p>
+</td>
+<td align="left" valign="top"><p>Why (function) cloning?</p></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"></td>
+<td align="left" valign="top"><p>In November and December of 2000, the issue of cloning
+ vs. reference counting was debated at length and it was decided
+ that cloning gave more predictable semantics. I won't rehash the
+ discussion here, but if it cloning is incorrect for a particular
+ application a reference-counting allocator could be used.</p></td>
+</tr>
+<tr class="question">
+<td align="left" valign="top">
+<a name="id1550330"></a><a name="id1550332"></a><p><b>5.</b></p>
+</td>
+<td align="left" valign="top"><p>How much overhead does a call through <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> incur?</p></td>
+</tr>
+<tr class="answer">
+<td align="left" valign="top"></td>
+<td align="left" valign="top">
+<p>The cost of <code class="computeroutput">boost::function</code> can be reasonably
+ consistently measured at around 20ns +/- 10 ns on a modern &gt;2GHz
+ platform versus directly inlining the code.</p>
+<p>However, the performance of your application may benefit
+ from or be disadvantaged by <code class="computeroutput">boost::function</code>
+ depending on how your C++ optimiser optimises. Similar to a
+ standard function pointer, differences of order of 10% have been
+ noted to the benefit or disadvantage of using
+ <code class="computeroutput">boost::function</code> to call a function that contains a
+ tight loop depending on your compilation circumstances.</p>
+<p>[Answer provided by Matt Hurd. See <a href="http://article.gmane.org/gmane.comp.lib.boost.devel/33278" target="_top">http://article.gmane.org/gmane.comp.lib.boost.devel/33278</a>]</p>
+</td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: November 03, 2006 at 19:41:10 +0000</small></p></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../boost/function_equal.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="misc.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
diff --git a/doc/html/function/history.html b/doc/html/function/history.html
new file mode 100755
index 0000000000..d44acfe3f2
--- /dev/null
+++ b/doc/html/function/history.html
@@ -0,0 +1,151 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>History &amp; Compatibility Notes</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="next" href="tutorial.html" title="Tutorial">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../function.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.history"></a>History &amp; Compatibility Notes</h2></div></div></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<li class="listitem">
+<p><span class="bold"><strong>Version 1.37.0</strong></span>: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle" compact>
+<li class="listitem"><p>Improved the performance of Boost.Function's
+ swap() operation for large function objects. Original patch
+ contributed by Niels Dekker.</p></li>
+<li class="listitem"><p>Added a new header &lt;boost/function/function_typeof.hpp&gt; that provides support for using the Boost.Typeof library on Boost.Function objects.</p></li>
+<li class="listitem"><p>Added a new header &lt;boost/function/function_fwd.hpp&gt; that provides support for using the Boost.Typeof library on Boost.Function objects.</p></li>
+<li class="listitem"><p>The <code class="computeroutput"><a class="link" href="../boost/function.html#id738592-bb">target</a></code>()
+ function now respects the cv-qualifiers of function objects
+ stored by reference
+ (using <code class="computeroutput"><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">boost::reference_wrapper</a></code>), such
+ that a reference to a <code class="computeroutput">const</code> function object cannot
+ be accessed as a reference to a non-<code class="computeroutput">const</code> function
+ object.</p></li>
+</ul></div>
+</li>
+<li class="listitem">
+<p><span class="bold"><strong>Version 1.36.0</strong></span>: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle" compact><li class="listitem"><p>Boost.Function now implements allocator support
+ in the same way that is is provided in C++0x, based on C++
+ committee
+ proposal <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html" target="_top">N2308</a>. This
+ change removes the <code class="computeroutput">Allocator</code>
+ template parameter of <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> in
+ favor of a constructor that takes an argument. While this is a
+ backward-incompatible change, it is likely to affect only a few
+ users. This change to Function was contributed by Emil
+ Dotchevski, which also authored the corresponding C++ committee
+ proposal.</p></li></ul></div>
+</li>
+<li class="listitem">
+<p><span class="bold"><strong>Version 1.34.0</strong></span>: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle" compact><li class="listitem"><p>Boost.Function now implements a small buffer optimization, which can drastically improve the performance when copying or construction Boost.Function objects storing small function objects. For instance, <code class="computeroutput">bind(&amp;X:foo, &amp;x, _1, _2)</code> requires no heap allocation when placed into a Boost.Function object. Note that some exception-safety guarantees have changed: assignment provides the basic exception guarantee and <code class="computeroutput">swap()</code> may throw.</p></li></ul></div>
+</li>
+<li class="listitem">
+<p><span class="bold"><strong>Version 1.30.0</strong></span>: </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle" compact>
+<li class="listitem"><p>All features deprecated in version 1.29.0 have
+ been removed from Boost.Function.</p></li>
+<li class="listitem"><p><code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>
+ and <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> objects
+ can be assigned to 0 (semantically equivalent to calling
+ <code class="computeroutput"><a class="link" href="../boost/function.html#id750484-bb">clear</a>()</code>) and
+ compared against 0 (semantically equivalent to calling
+ <code class="computeroutput"><a class="link" href="../boost/function.html#id677638-bb">empty</a>()</code>).</p></li>
+<li class="listitem"><p>The Boost.Function code is now generated
+ entirely by the <a href="../../../libs/preprocessor/index.html" target="_top">Preprocessor</a> library,
+ so it is now possible to generate
+ <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> and
+ <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> class
+ templates for any number of arguments.</p></li>
+<li class="listitem"><p>The
+ <code class="computeroutput"><a class="link" href="../boost/bad_function_call.html" title="Class bad_function_call">boost::bad_function_call</a></code> exception class
+ was introduced.</p></li>
+</ul></div>
+</li>
+<li class="listitem">
+<p><span class="bold"><strong>Version 1.29.0</strong></span>:
+ Boost.Function has been partially redesigned to minimize the
+ interface and make it cleaner. Several seldom- or never-used
+ features of the older Boost.Function have been deprecated and will
+ be removed in the near future. Here is a list of features that have
+ been deprecated, the likely impact of the deprecations, and how to
+ adjust your code:
+
+</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle" compact>
+<li class="listitem">
+<p>The <code class="computeroutput">boost::function</code> class template syntax has
+ changed. The old syntax, e.g., <code class="computeroutput">boost::function&lt;int, float,
+ double, std::string&gt;</code>, has been changed to a more natural
+ syntax <code class="computeroutput">boost::function&lt;int (float, double,
+ std::string)&gt;</code>, where all return and argument types are
+ encoded in a single function type parameter. Any other template
+ parameters (e.g., the <code class="computeroutput">Allocator</code>) follow this single
+ parameter.</p>
+<p> The resolution to this change depends on the
+ abilities of your compiler: if your compiler supports template
+ partial specialization and can parse function types (most do), modify
+ your code to use the newer
+ syntax (preferable) or directly use one of the
+ <code class="computeroutput">functionN</code> classes whose syntax has not
+ changed. If your compiler does not support template partial
+ specialization or function types, you must take the latter option and
+ use the numbered Boost.Function classes. This option merely requires
+ changing types such as <code class="computeroutput">boost::function&lt;void, int, int&gt;</code>
+ to <code class="computeroutput">boost::function2&lt;void, int, int&gt;</code> (adding the number of
+ function arguments to the end of the class name).</p>
+<p> Support for the old syntax with the
+ <code class="computeroutput">boost::function</code> class template will persist for a short
+ while, but will eventually be removed so that we can provide better
+ error messages and link compatibility. </p>
+</li>
+<li class="listitem"><p>The invocation
+ policy template parameter (<code class="computeroutput">Policy</code>) has been deprecated
+ and will be removed. There is no direct equivalent to this rarely
+ used feature.</p></li>
+<li class="listitem"><p>The mixin template parameter
+ (<code class="computeroutput">Mixin</code>) has been deprecated and will be removed. There
+ is not direct equivalent to this rarely used feature.</p></li>
+<li class="listitem"><p>The
+ <code class="computeroutput">set</code> methods have been deprecated and will be
+ removed. Use the assignment operator instead.</p></li>
+</ul></div>
+<p>
+</p>
+</li>
+</ul></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: October 16, 2008 at 14:21:50 +0100</small></p></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../function.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
diff --git a/doc/html/function/misc.html b/doc/html/function/misc.html
new file mode 100755
index 0000000000..2b0250f8f9
--- /dev/null
+++ b/doc/html/function/misc.html
@@ -0,0 +1,111 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Miscellaneous Notes</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="faq.html" title="Frequently Asked Questions">
+<link rel="next" href="testsuite.html" title="Testsuite">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="faq.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="testsuite.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.misc"></a>Miscellaneous Notes</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="misc.html#id1550410">Boost.Function vs. Function Pointers</a></span></dt>
+<dt><span class="section"><a href="misc.html#id1550476">Performance</a></span></dt>
+<dt><span class="section"><a href="misc.html#id1550549">Combatting virtual function "bloat"</a></span></dt>
+<dt><span class="section"><a href="misc.html#id1550575">Acknowledgements</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1550410"></a>Boost.Function vs. Function Pointers</h3></div></div></div>
+<p>Boost.Function has several advantages over function pointers, namely:
+
+</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<li class="listitem"><p>Boost.Function allows arbitrary compatible function objects to be targets (instead of requiring an exact function signature).</p></li>
+<li class="listitem"><p>Boost.Function may be used with argument-binding and other function object construction libraries.</p></li>
+<li class="listitem"><p>Boost.Function has predictible behavior when an empty function object is called. </p></li>
+</ul></div>
+<p> And, of course, function pointers have several advantages over Boost.Function:
+
+</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<li class="listitem"><p> Function pointers are smaller (the size of one pointer instead of four or more) </p></li>
+<li class="listitem"><p> Function pointers are faster (Boost.Function may require two calls through function pointers) </p></li>
+<li class="listitem"><p> Function pointers are backward-compatible with C libraries.</p></li>
+<li class="listitem"><p> More readable error messages. </p></li>
+</ul></div>
+<p>
+</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1550476"></a>Performance</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="misc.html#id1550481">Function object wrapper size</a></span></dt>
+<dt><span class="section"><a href="misc.html#id1550505">Copying efficiency</a></span></dt>
+<dt><span class="section"><a href="misc.html#id1550533">Invocation efficiency</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id1550481"></a>Function object wrapper size</h4></div></div></div>
+<p> Function object wrappers will be the size of a struct containing a member function pointer and two data pointers. The actual size can vary significantly depending on the underlying platform; on 32-bit Mac OS X with GCC, this amounts to 16 bytes, while it is 32 bytes Windows with Visual C++. Additionally, the function object target may be allocated on the heap, if it cannot be placed into the small-object buffer in the <code class="computeroutput">boost::function</code> object.</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id1550505"></a>Copying efficiency</h4></div></div></div>
+<p> Copying function object wrappers may require allocating memory for a copy of the function object target. The default allocator may be replaced with a faster custom allocator or one may choose to allow the function object wrappers to only store function object targets by reference (using <code class="computeroutput">ref</code>) if the cost of this cloning becomes prohibitive. Small function objects can be stored within the <code class="computeroutput">boost::function</code> object itself, improving copying efficiency.</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="id1550533"></a>Invocation efficiency</h4></div></div></div>
+<p> With a properly inlining compiler, an invocation of a function object requires one call through a function pointer. If the call is to a free function pointer, an additional call must be made to that function pointer (unless the compiler has very powerful interprocedural analysis).</p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1550549"></a>Combatting virtual function "bloat"</h3></div></div></div>
+<p> The use of virtual functions tends to cause 'code bloat' on many compilers. When a class contains a virtual function, it is necessary to emit an additional function that classifies the type of the object. It has been our experience that these auxiliary functions increase the size of the executable significantly when many <code class="computeroutput">boost::function</code> objects are used. </p>
+<p> In Boost.Function, an alternative but equivalent approach was taken using free functions instead of virtual functions. The Boost.Function object essentially holds two pointers to make a valid target call: a void pointer to the function object it contains and a void pointer to an "invoker" that can call the function object, given the function pointer. This invoker function performs the argument and return value conversions Boost.Function provides. A third pointer points to a free function called the "manager", which handles the cloning and destruction of function objects. The scheme is typesafe because the only functions that actually handle the function object, the invoker and the manager, are instantiated given the type of the function object, so they can safely cast the incoming void pointer (the function object pointer) to the appropriate type.</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1550575"></a>Acknowledgements</h3></div></div></div>
+<p> Many people were involved in the construction of this
+ library. William Kempf, Jesse Jones and Karl Nelson were all
+ extremely helpful in isolating an interface and scope for the
+ library. John Maddock managed the formal review, and many
+ reviewers gave excellent comments on interface, implementation,
+ and documentation. Peter Dimov led us to the function
+ declarator-based syntax.</p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: July 14, 2008 at 19:32:29 +0100</small></p></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="faq.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="testsuite.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
diff --git a/doc/html/function/reference.html b/doc/html/function/reference.html
new file mode 100755
index 0000000000..7b267b5b41
--- /dev/null
+++ b/doc/html/function/reference.html
@@ -0,0 +1,175 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Reference</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="tutorial.html" title="Tutorial">
+<link rel="next" href="../boost/bad_function_call.html" title="Class bad_function_call">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/bad_function_call.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.reference"></a>Reference</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#function.definitions">Definitions</a></span></dt>
+<dt><span class="section"><a href="reference.html#header.boost.function_hpp">Header &lt;boost/function.hpp&gt;</a></span></dt>
+<dt><span class="section"><a href="reference.html#header.boost.function_equal_hpp">Header &lt;boost/function_equal.hpp&gt;</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="function.definitions"></a>Definitions</h3></div></div></div>
+<p>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p>A function object <code class="computeroutput">f</code> is
+ <span class="emphasis"><em>compatible</em></span> if for the given set of argument
+ types <code class="computeroutput">Arg1</code>,
+ <code class="computeroutput">Arg2</code>, ...,
+ <code class="computeroutput">ArgN</code> and a
+ return type <code class="computeroutput">ResultType</code>, the
+ appropriate following function is well-formed:
+</p>
+<pre class="programlisting">
+ <span class="emphasis"><em>// if ResultType is not <span class="bold"><strong>void</strong></span></em></span>
+ ResultType foo(Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>)
+ {
+ <span class="bold"><strong>return</strong></span> f(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
+ }
+
+ <span class="emphasis"><em>// if ResultType is <span class="bold"><strong>void</strong></span></em></span>
+ ResultType foo(Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>)
+ {
+ f(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
+ }
+</pre>
+<p> A special provision is made for pointers to member
+ functions. Though they are not function objects, Boost.Function
+ will adapt them internally to function objects. This requires
+ that a pointer to member function of the form <code class="computeroutput">R
+ (X::*mf)(Arg1, Arg2, ..., ArgN)
+ cv-quals</code> be adapted to a
+ function object with the following function call operator
+ overloads:
+</p>
+<pre class="programlisting">
+ <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename P</strong></span>&gt;
+ R <span class="bold"><strong>operator</strong></span>()(<span class="emphasis"><em>cv-quals</em></span> P&amp; x, Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>) <span class="bold"><strong>const</strong></span>
+ {
+ <span class="bold"><strong>return</strong></span> (*x).*mf(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
+ }
+</pre>
+<p>
+</p>
+</li>
+<li class="listitem"><p>A function object <code class="computeroutput">f</code> of
+ type <code class="computeroutput">F</code> is
+ <span class="emphasis"><em>stateless</em></span> if it is a function pointer or if
+ <code class="computeroutput">boost::is_stateless&lt;T&gt;</code>
+ is true. The construction of or copy to a Boost.Function object
+ from a stateless function object will not cause exceptions to be
+ thrown and will not allocate any storage.
+ </p></li>
+</ul></div>
+<p>
+</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.function_hpp"></a>Header &lt;<a href="../../../boost/function.hpp" target="_top">boost/function.hpp</a>&gt;</h3></div></div></div>
+<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">class</span> <a class="link" href="../boost/bad_function_call.html" title="Class bad_function_call">bad_function_call</a><span class="special">;</span>
+ <span class="keyword">class</span> <a class="link" href="../boost/function_base.html" title="Class function_base">function_base</a><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> R<span class="special">,</span> <span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">&gt;</span>
+ <span class="keyword">class</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/functionN.html#boost.functionN.swap_id671161"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id719607-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="identifier">Functor</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id745323-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="identifier">Functor</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id371430-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span>
+ <a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id332978-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">,</span>
+ <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> U1<span class="special">,</span>
+ <span class="keyword">typename</span> U2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> UN<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/functionN.html#id442127-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span>
+ <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">UN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id699682-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="identifier">Functor</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id749405-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="identifier">Functor</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id717373-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span>
+ <a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/functionN.html#id739147-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">,</span>
+ <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T1<span class="special">,</span> <span class="keyword">typename</span> T2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> TN<span class="special">,</span> <span class="keyword">typename</span> U1<span class="special">,</span>
+ <span class="keyword">typename</span> U2<span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> UN<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/functionN.html#id750812-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">TN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span>
+ <span class="keyword">const</span> <a class="link" href="../boost/functionN.html" title="Class template functionN">functionN</a><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">UN</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">&gt;</span> <span class="keyword">class</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/function.html#boost.function.swap_id738378"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id373829-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="identifier">Functor</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id752354-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="identifier">Functor</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id439893-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id449565-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature1<span class="special">,</span> <span class="keyword">typename</span> Signature2<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/function.html#id672809-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature1</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature2</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id445100-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="identifier">Functor</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id717028-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="identifier">Functor</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id372931-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">,</span> <span class="keyword">typename</span> Functor<span class="special">&gt;</span>
+ <span class="keyword">bool</span> <a class="link" href="../boost/function.html#id742476-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><span class="special">&lt;</span><span class="identifier">Functor</span><span class="special">&gt;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature1<span class="special">,</span> <span class="keyword">typename</span> Signature2<span class="special">&gt;</span>
+ <span class="keyword">void</span> <a class="link" href="../boost/function.html#id333115-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature1</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../boost/function.html" title="Class template function">function</a><span class="special">&lt;</span><span class="identifier">Signature2</span><span class="special">&gt;</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span></pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.function_equal_hpp"></a>Header &lt;<a href="../../../boost/function_equal.hpp" target="_top">boost/function_equal.hpp</a>&gt;</h3></div></div></div>
+<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> F<span class="special">,</span> <span class="keyword">typename</span> G<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="../boost/function_equal.html" title="Function template function_equal"><span class="identifier">function_equal</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">F</span><span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">G</span><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
+<span class="special">}</span></pre>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/bad_function_call.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
diff --git a/doc/html/function/testsuite.html b/doc/html/function/testsuite.html
new file mode 100755
index 0000000000..c8a65eb8f8
--- /dev/null
+++ b/doc/html/function/testsuite.html
@@ -0,0 +1,199 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Testsuite</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="misc.html" title="Miscellaneous Notes">
+<link rel="next" href="../hash.html" title="Chapter&#160;10.&#160;Boost.Functional/Hash">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="misc.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../hash.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.testsuite"></a>Testsuite</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="testsuite.html#function.testsuite.acceptance">Acceptance tests</a></span></dt>
+<dt><span class="section"><a href="testsuite.html#function.testsuite.negative">Negative tests</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="function.testsuite.acceptance"></a>Acceptance tests</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col width="1in">
+<col>
+</colgroup>
+<thead><tr>
+<th>Test</th>
+<th>Type</th>
+<th>Description</th>
+<th>If failing...</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><p><a href="../../../libs/function/test/function_test.cpp" target="_top">function_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the capabilities of the <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> class template.</p></td>
+<td><p>The <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> class template may not be usable on your compiler. However, the library may still be usable via the <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> class templates.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_n_test.cpp" target="_top">function_n_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the capabilities of the <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> class templates.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/allocator_test.cpp" target="_top">allocator_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the use of custom allocators.</p></td>
+<td><p>Allocators are ignored by the implementation.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/stateless_test.cpp" target="_top">stateless_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the optimization of stateless function objects in the Boost.Function library.</p></td>
+<td><p>The exception-safety and performance guarantees given for stateless function objects may not be met by the implementation.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/lambda_test.cpp" target="_top">lambda_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the interaction between Boost.Function and Boost.Lambda.</p></td>
+<td><p>Either Boost.Lambda does not work on the platform, or Boost.Function cannot safely be applied without the use of <code class="computeroutput">boost::unlambda</code>.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/contains_test.cpp" target="_top">contains_test.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the operation of the
+ <code class="computeroutput">target</code> member function and the
+ equality operators.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_30.cpp" target="_top">function_30.cpp</a></p></td>
+<td><p>compile</p></td>
+<td><p>Test the generation of a Boost.Function function object adaptor accepting 30 arguments.</p></td>
+<td><p>The Boost.Function library may work for function object adaptors of up to 10 parameters, but will be unable to generate adaptors for an arbitrary number of parameters. Failure often indicates an error in the compiler's preprocessor.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_arith_cxx98.cpp" target="_top">function_arith_cxx98.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the first tutorial example.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_arith_portable.cpp" target="_top">function_arith_portable.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the first tutorial example.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/sum_avg_cxx98.cpp" target="_top">sum_avg_cxx98.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the second tutorial example.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/sum_avg_portable.cpp" target="_top">sum_avg_portable.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test the second tutorial example.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/mem_fun_cxx98.cpp" target="_top">mem_fun_cxx98.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test member function example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/mem_fun_portable.cpp" target="_top">mem_fun_portable.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test member function example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/std_bind_cxx98.cpp" target="_top">std_bind_cxx98.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test standard binders example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/std_bind_portable.cpp" target="_top">std_bind_portable.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test standard binders example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_ref_cxx98.cpp" target="_top">function_ref_cxx98.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test <code class="computeroutput">boost::ref</code> example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_ref_portable.cpp" target="_top">function_ref_portable.cpp</a></p></td>
+<td><p>run</p></td>
+<td><p>Test <code class="computeroutput">boost::ref</code> example from tutorial.</p></td>
+<td>&#160;</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="function.testsuite.negative"></a>Negative tests</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col width="1in">
+<col>
+</colgroup>
+<thead><tr>
+<th>Test</th>
+<th>Type</th>
+<th>Description</th>
+<th>If failing...</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><p><a href="../../../libs/function/test/function_test_fail1.cpp" target="_top">function_test_fail1.cpp</a></p></td>
+<td><p>compile-fail</p></td>
+<td><p>Test the (incorrect!) use of comparisons between Boost.Function function objects.</p></td>
+<td><p>Intuitive (but incorrect!) code may compile and will give meaningless results.</p></td>
+</tr>
+<tr>
+<td><p><a href="../../../libs/function/test/function_test_fail2.cpp" target="_top">function_test_fail2.cpp</a></p></td>
+<td><p>compile-fail</p></td>
+<td><p>Test the use of an incompatible function object with Boost.Function</p></td>
+<td><p>Incorrect code may compile (with potentially unexpected results).</p></td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="misc.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../hash.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
diff --git a/doc/html/function/tutorial.html b/doc/html/function/tutorial.html
new file mode 100755
index 0000000000..2dc8f10950
--- /dev/null
+++ b/doc/html/function/tutorial.html
@@ -0,0 +1,390 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Tutorial</title>
+<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="prev" href="history.html" title="History &amp; Compatibility Notes">
+<link rel="next" href="reference.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center"><a href="../../../index.html">Home</a></td>
+<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
+<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
+<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="history.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="function.tutorial"></a>Tutorial</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#id1529542">Basic Usage</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#id1529905">Free functions</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#id1529941">Member functions</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#id1530160">References to Function Objects</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#id1530326">Comparing Boost.Function function objects</a></span></dt>
+</dl></div>
+<p> Boost.Function has two syntactical forms: the preferred form
+and the portable form. The preferred form fits more closely with the
+C++ language and reduces the number of separate template parameters
+that need to be considered, often improving readability; however, the
+preferred form is not supported on all platforms due to compiler
+bugs. The compatible form will work on all compilers supported by
+Boost.Function. Consult the table below to determine which syntactic
+form to use for your compiler.
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th align="left">Preferred syntax</th>
+<th align="left">Portable syntax</th>
+</tr></thead>
+<tbody><tr>
+<td align="left">
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<li class="listitem">GNU C++ 2.95.x, 3.0.x and later versions</li>
+<li class="listitem">Comeau C++ 4.2.45.2</li>
+<li class="listitem">SGI MIPSpro 7.3.0</li>
+<li class="listitem">Intel C++ 5.0, 6.0</li>
+<li class="listitem">Compaq's cxx 6.2</li>
+<li class="listitem">Microsoft Visual C++ 7.1 and later versions</li>
+</ul></div>
+ </td>
+<td align="left">
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<li class="listitem"><span class="emphasis"><em>Any compiler supporting the preferred syntax</em></span></li>
+<li class="listitem">Microsoft Visual C++ 6.0, 7.0</li>
+<li class="listitem">Borland C++ 5.5.1</li>
+<li class="listitem">Sun WorkShop 6 update 2 C++ 5.3</li>
+<li class="listitem">Metrowerks CodeWarrior 8.1</li>
+</ul></div>
+ </td>
+</tr></tbody>
+</table></div>
+<p>
+
+</p>
+<p> If your compiler does not appear in this list, please try the preferred syntax and report your results to the Boost list so that we can keep this table up-to-date.</p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1529542"></a>Basic Usage</h3></div></div></div>
+<p> A function wrapper is defined simply
+by instantiating the <code class="computeroutput">function</code> class
+template with the desired return type and argument types, formulated
+as a C++ function type. Any number of arguments may be supplied, up to
+some implementation-defined limit (10 is the default maximum). The
+following declares a function object wrapper
+<code class="computeroutput">f</code> that takes two
+<code class="computeroutput">int</code> parameters and returns a
+<code class="computeroutput">float</code>:
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th align="left">Preferred syntax</th>
+<th align="left">Portable syntax</th>
+</tr></thead>
+<tbody><tr>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;float (int x, int y)&gt; f;</pre>
+</td>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function2</a></code>&lt;float, int, int&gt; f;</pre>
+</td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p> By default, function object wrappers are empty, so we can create a
+function object to assign to <code class="computeroutput">f</code>:
+
+</p>
+<pre class="programlisting">struct int_div {
+ float operator()(int x, int y) const { return ((float)x)/y; };
+};</pre>
+<p>
+</p>
+<pre class="programlisting">f = int_div();</pre>
+<p>
+</p>
+<p> Now we can use <code class="computeroutput">f</code> to execute
+the underlying function object
+<code class="computeroutput">int_div</code>:
+
+</p>
+<pre class="programlisting">std::cout &lt;&lt; f(5, 3) &lt;&lt; std::endl;</pre>
+<p>
+</p>
+<p> We are free to assign any compatible function object to
+<code class="computeroutput">f</code>. If
+<code class="computeroutput">int_div</code> had been declared to take two
+<code class="computeroutput">long</code> operands, the implicit
+conversions would have been applied to the arguments without any user
+interference. The only limit on the types of arguments is that they be
+CopyConstructible, so we can even use references and arrays:
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th align="left">Preferred syntax</th></tr></thead>
+<tbody><tr><td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;void (int values[], int n, int&amp; sum, float&amp; avg)&gt; sum_avg;</pre>
+</td></tr></tbody>
+</table></div>
+<p>
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th align="left">Portable syntax</th></tr></thead>
+<tbody><tr><td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function4</a></code>&lt;void, int*, int, int&amp;, float&amp;&gt; sum_avg;</pre>
+</td></tr></tbody>
+</table></div>
+<p>
+
+</p>
+<pre class="programlisting">void do_sum_avg(int values[], int n, int&amp; sum, float&amp; avg)
+{
+ sum = 0;
+ for (int i = 0; i &lt; n; i++)
+ sum += values[i];
+ avg = (float)sum / n;
+}</pre>
+<p>
+
+
+</p>
+<pre class="programlisting">sum_avg = &amp;do_sum_avg;</pre>
+<p>
+</p>
+<p> Invoking a function object wrapper that does not actually
+contain a function object is a precondition violation, much like
+trying to call through a null function pointer, and will throw a <code class="computeroutput"><a class="link" href="../boost/bad_function_call.html" title="Class bad_function_call">bad_function_call</a></code> exception). We can check for an
+empty function object wrapper by using it in a boolean context (it evaluates <code class="computeroutput">true</code> if the wrapper is not empty) or compare it against <code class="computeroutput">0</code>. For instance:
+</p>
+<pre class="programlisting">if (f)
+ std::cout &lt;&lt; f(5, 3) &lt;&lt; std::endl;
+else
+ std::cout &lt;&lt; "f has no target, so it is unsafe to call" &lt;&lt; std::endl;</pre>
+<p>
+</p>
+<p> Alternatively,
+<code class="computeroutput"><code class="computeroutput"><a class="link" href="../boost/function.html#id677638-bb">empty</a></code>()</code>
+method will return whether or not the wrapper is empty. </p>
+<p> Finally, we can clear out a function target by assigning it to <code class="computeroutput">0</code> or by calling the <code class="computeroutput"><code class="computeroutput"><a class="link" href="../boost/function.html#id750484-bb">clear</a></code>()</code> member function, e.g.,
+</p>
+<pre class="programlisting">f = 0;</pre>
+<p>
+</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1529905"></a>Free functions</h3></div></div></div>
+<p> Free function pointers can be considered singleton function objects with const function call operators, and can therefore be directly used with the function object wrappers:
+</p>
+<pre class="programlisting">float mul_ints(int x, int y) { return ((float)x) * y; }</pre>
+<p>
+</p>
+<pre class="programlisting">f = &amp;mul_ints;</pre>
+<p>
+</p>
+<p> Note that the <code class="computeroutput">&amp;</code> isn't really necessary unless you happen to be using Microsoft Visual C++ version 6. </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1529941"></a>Member functions</h3></div></div></div>
+<p> In many systems, callbacks often call to member functions of a
+particular object. This is often referred to as "argument binding",
+and is beyond the scope of Boost.Function. The use of member functions
+directly, however, is supported, so the following code is valid:
+
+</p>
+<pre class="programlisting">struct X {
+ int foo(int);
+};</pre>
+<p>
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th align="left">Preferred syntax</th>
+<th align="left">Portable syntax</th>
+</tr></thead>
+<tbody><tr>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;int (X*, int)&gt; f;
+
+f = &amp;X::foo;
+
+X x;
+f(&amp;x, 5);</pre>
+</td>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function2</a></code>&lt;int, X*, int&gt; f;
+
+f = &amp;X::foo;
+
+X x;
+f(&amp;x, 5);</pre>
+</td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p> Several libraries exist that support argument binding. Three such libraries are summarized below:
+</p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><p><a href="../../../libs/bind/index.html" target="_top">Bind</a>. This library allows binding of
+ arguments for any function object. It is lightweight and very
+ portable.</p></li>
+<li class="listitem">
+<p>The C++ Standard library. Using
+ <code class="computeroutput">std::bind1st</code> and
+ <code class="computeroutput">std::mem_fun</code> together one can bind
+ the object of a pointer-to-member function for use with
+ Boost.Function:
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th align="left">Preferred syntax</th>
+<th align="left">Portable syntax</th>
+</tr></thead>
+<tbody><tr>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;int (int)&gt; f;
+X x;
+f = std::bind1st(
+ std::mem_fun(&amp;X::foo), &amp;x);
+f(5); // Call x.foo(5)</pre>
+</td>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function1</a></code>&lt;int, int&gt; f;
+X x;
+f = std::bind1st(
+ std::mem_fun(&amp;X::foo), &amp;x);
+f(5); // Call x.foo(5)</pre>
+</td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+</li>
+<li class="listitem"><p>The <a class="link" href="../lambda.html" title="Chapter&#160;14.&#160;Boost.Lambda">Lambda</a> library. This library provides a powerful composition mechanism to construct function objects that uses very natural C++ syntax. Lambda requires a compiler that is reasonably conformant to the C++ standard. </p></li>
+</ul></div>
+<p>
+</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1530160"></a>References to Function Objects</h3></div></div></div>
+<p> In some cases it is
+ expensive (or semantically incorrect) to have Boost.Function clone a
+ function object. In such cases, it is possible to request that
+ Boost.Function keep only a reference to the actual function
+ object. This is done using the <code class="computeroutput">ref</code>
+ and <code class="computeroutput">cref</code> functions to wrap a
+ reference to a function object:
+
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th align="left">Preferred syntax</th>
+<th align="left">Portable syntax</th>
+</tr></thead>
+<tbody><tr>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">stateful_type a_function_object;
+<code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;int (int)&gt; f;
+f = <code class="computeroutput">boost::ref</code>(a_function_object);
+
+<code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>&lt;int (int)&gt; f2(f);</pre>
+</td>
+<td align="left">
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting">stateful_type a_function_object;
+<code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function1</a></code>&lt;int, int&gt; f;
+f = <code class="computeroutput">boost::ref</code>(a_function_object);
+
+<code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::function1</a></code>&lt;int, int&gt; f2(f);</pre>
+</td>
+</tr></tbody>
+</table></div>
+<p>
+</p>
+<p> Here, <code class="computeroutput">f</code> will not make a copy
+of <code class="computeroutput">a_function_object</code>, nor will
+<code class="computeroutput">f2</code> when it is targeted to
+<code class="computeroutput">f</code>'s reference to
+<code class="computeroutput">a_function_object</code>. Additionally, when
+using references to function objects, Boost.Function will not throw
+exceptions during assignment or construction.
+</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id1530326"></a>Comparing Boost.Function function objects</h3></div></div></div>
+<p>Function object wrappers can be compared via <code class="computeroutput">==</code>
+ or <code class="computeroutput">!=</code> against any function object that can be stored
+ within the wrapper. If the function object wrapper contains a
+ function object of that type, it will be compared against the given
+ function object (which must be either be
+ <a class="link" href="../EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a> or have an overloaded <code class="computeroutput"><a class="link" href="../boost/function_equal.html" title="Function template function_equal">boost::function_equal</a></code>). For instance:</p>
+<pre class="programlisting">int compute_with_X(X*, int);
+
+f = &amp;X::foo;
+assert(f == &amp;X::foo);
+assert(&amp;compute_with_X != f);</pre>
+<p>When comparing against an instance of
+ <code class="computeroutput"><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a></code>, the address
+ of the object in the
+ <code class="computeroutput"><a class="link" href="../boost/reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a></code> is compared
+ against the address of the object stored by the function object
+ wrapper:</p>
+<pre class="programlisting">a_stateful_object so1, so2;
+f = <code class="computeroutput">boost::ref</code>(so1);
+assert(f == <code class="computeroutput">boost::ref</code>(so1));
+assert(f == so1); <span class="emphasis"><em>// Only if a_stateful_object is <a class="link" href="../EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a></em></span>
+assert(f != <code class="computeroutput">boost::ref</code>(so2));</pre>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: July 12, 2009 at 17:13:35 +0100</small></p></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="history.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>