|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76815 - in sandbox/local_function/libs: functional/overloaded_function/doc/html/boost_functional_overloadedfunction functional/overloaded_function/doc/html/functional_overloaded_function local_function local_function/doc/html local_function/example scope_exit
From: lorcaminiti_at_[hidden]
Date: 2012-01-31 19:05:18
Author: lcaminiti
Date: 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
New Revision: 76815
URL: http://svn.boost.org/trac/boost/changeset/76815
Log:
Updated docs.
Added:
sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/
sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html (contents, props changed)
sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html (contents, props changed)
sandbox/local_function/libs/local_function/example/test_impl_factorial.cpp (contents, props changed)
sandbox/local_function/libs/local_function/index.html (contents, props changed)
sandbox/local_function/libs/scope_exit/index.html (contents, props changed)
Removed:
sandbox/local_function/libs/functional/overloaded_function/doc/html/functional_overloaded_function/
sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX.html
sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_END.html
Added: sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html
==============================================================================
--- (empty file)
+++ sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Getting_Started.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
@@ -0,0 +1,81 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Getting Started</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="Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
+<link rel="prev" href="../index.html" title="Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
+<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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="boost_functional_overloadedfunction.Getting_Started"></a><a class="link" href="Getting_Started.html" title="Getting Started">Getting
+ Started</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="Getting_Started.html#boost_functional_overloadedfunction.Getting_Started.compilers_and_platforms">Compilers
+ and Platforms</a></span></dt>
+<dt><span class="section">Installation</span></dt>
+</dl></div>
+<p>
+ This section explains how to setup a system to use this library.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_functional_overloadedfunction.Getting_Started.compilers_and_platforms"></a><a class="link" href="Getting_Started.html#boost_functional_overloadedfunction.Getting_Started.compilers_and_platforms" title="Compilers and Platforms">Compilers
+ and Platforms</a>
+</h3></div></div></div>
+<p>
+ The library was tested by the authors on GCC 4.5.3 (with and without C++11
+ features <code class="literal">-std=c++0x</code>) and MSVC 8.0 under Linux, Cygwin,
+ and Windows 7.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_functional_overloadedfunction.Getting_Started.installation"></a><a class="link" href="Getting_Started.html#boost_functional_overloadedfunction.Getting_Started.installation" title="Installation">Installation</a>
+</h3></div></div></div>
+<p>
+ This library is composed of header files only. Therefore there is no pre-compiled
+ object file which needs to be installed. Programmers can simply instruct
+ the compiler where to find the library header files (<code class="computeroutput"><span class="special">-</span><span class="identifier">I</span></code> option on GCC, <code class="computeroutput"><span class="special">/</span><span class="identifier">I</span></code> option on MSVC, etc) and compile code
+ using the library.
+ </p>
+<p>
+ The maximum number of functions to overload is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</a></code>
+ configuration macro. The maximum number of function parameters for each of
+ the specified function types is given by the <code class="computeroutput"><a class="link" href="../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title="Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</a></code>
+ configuration macro. All configuration macros have appropriate default values
+ when they are left undefined by the user.
+ </p>
+</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 © 2011, 2012 Lorenzo Caminiti<p>
+ Distributed under the Boost Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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>
Added: sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html
==============================================================================
--- (empty file)
+++ sandbox/local_function/libs/functional/overloaded_function/doc/html/boost_functional_overloadedfunction/Tutorial.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
@@ -0,0 +1,202 @@
+<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="Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
+<link rel="prev" href="Getting_Started.html" title="Getting Started">
+<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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Getting_Started.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="boost_functional_overloadedfunction.Tutorial"></a><a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Overloading</span></dt>
+<dt><span class="section"><a href="Tutorial.html#boost_functional_overloadedfunction.Tutorial.without_function_types">Without
+ Function Types</a></span></dt>
+</dl></div>
+<p>
+ This section explains how to use this library.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_functional_overloadedfunction.Tutorial.overloading"></a><a class="link" href="Tutorial.html#boost_functional_overloadedfunction.Tutorial.overloading" title="Overloading">Overloading</a>
+</h3></div></div></div>
+<p>
+ Consider the following functions with distinct signatures:
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">identity_s</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span> <span class="comment">// As pointer.</span>
+
+<span class="keyword">int</span> <span class="identifier">identity_i_impl</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
+<span class="keyword">int</span> <span class="special">(&</span><span class="identifier">identity_i</span><span class="special">)(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">identity_i_impl</span><span class="special">;</span> <span class="comment">// Function reference.</span>
+
+<span class="keyword">double</span> <span class="identifier">identity_d_impl</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">x</span><span class="special">;</span> <span class="special">}</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span><span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)></span> <span class="identifier">identity_d</span> <span class="special">=</span> <span class="identifier">identity_d_impl</span><span class="special">;</span> <span class="comment">// Functor.</span>
+</pre>
+<p>
+ </p>
+<p>
+ This library header <code class="computeroutput"><a class="link" href="../reference.html#header.boost.functional.overloaded_function_hpp" title="Header <boost/functional/overloaded_function.hpp>">boost/functional/overloaded_function.hpp</a></code>
+ provides a <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ class template that creates a single overloaded function object that can
+ be used to call the specified functions instead of using the separate function
+ names (see also identity.cpp
):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">overloaded_function</span><span class="special"><</span>
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&)</span>
+ <span class="special">,</span> <span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span>
+ <span class="special">,</span> <span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)</span>
+<span class="special">></span> <span class="identifier">identity</span><span class="special">(</span><span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">);</span>
+
+<span class="comment">// All calls via single `identity` function.</span>
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Note how function types in the following format are passed as template parameters
+ to <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ (this is the format of Boost.Function's
+ preferred syntax):
+ </p>
+<pre class="programlisting"><span class="emphasis"><em>result-type</em></span> <span class="special">(</span><span class="emphasis"><em>argument1-type</em></span><span class="special">,</span> <span class="emphasis"><em>argument2-type</em></span><span class="special">,</span> <span class="special">...)</span>
+</pre>
+<p>
+ Then the relative function pointers, function references, or <a href="http://en.wikipedia.org/wiki/Polymorphism_(computer_science)" target="_top">monomorphic
+ function</a> objects are passed to the <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ constructor matching the order of the specified template parameters. <sup>[<a name="boost_functional_overloadedfunction.Tutorial.overloading.f0" href="#ftn.boost_functional_overloadedfunction.Tutorial.overloading.f0" class="footnote">2</a>]</sup> In the above example, <code class="computeroutput"><span class="identifier">identity_s</span></code>
+ is passed as function pointer (the function address is automatically taken
+ from the function name by compiler), <code class="computeroutput"><span class="identifier">identity_i</span></code>
+ as function reference, and <code class="computeroutput"><span class="identifier">identity_d</span></code>
+ as function object.
+ </p>
+<p>
+ All specified function types must have distinct parameters from one another
+ (so the overloaded calls can be resolved by this library). <sup>[<a name="boost_functional_overloadedfunction.Tutorial.overloading.f1" href="#ftn.boost_functional_overloadedfunction.Tutorial.overloading.f1" class="footnote">3</a>]</sup> In order to create an overloaded function object, it is necessary
+ to specify at least two function types (because there is nothing to overload
+ between one or zero functions).
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_functional_overloadedfunction.Tutorial.without_function_types"></a><a class="link" href="Tutorial.html#boost_functional_overloadedfunction.Tutorial.without_function_types" title="Without Function Types">Without
+ Function Types</a>
+</h3></div></div></div>
+<p>
+ For convenience, this library also provides the <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
+ function template which allows to create the overloaded function object without
+ explicitly specifying the function types. The function types are automatically
+ deduced from the specified functions and the appropriate <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ instantiation is returned by <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>.
+ </p>
+<p>
+ The <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
+ function template can be useful when used together with Boost.Typeof's
+ <code class="computeroutput"><span class="identifier">BOOST_AUTO</span></code> (or C++11 <code class="computeroutput"><span class="keyword">auto</span></code>). For example (see also identity.cpp
):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">identity</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_overloaded_function</span><span class="special">(</span>
+ <span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">));</span>
+
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
+<span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ Note how the overloaded function object <code class="computeroutput"><span class="identifier">identity</span></code>
+ has been created specifying only the functions <code class="computeroutput"><span class="identifier">identity_s</span></code>,
+ <code class="computeroutput"><span class="identifier">identity_i</span></code>, <code class="computeroutput"><span class="identifier">identity_d</span></code> and without specifying the function
+ types <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="special">(</span><span class="keyword">const</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&)</span></code>,
+ <code class="computeroutput"><span class="keyword">int</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)</span></code>, and
+ <code class="computeroutput"><span class="keyword">double</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)</span></code> as
+ required instead by <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>.
+ Therefore, <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
+ provides a more concise syntax in this context when compared with <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>.
+ </p>
+<p>
+ Another case where <code class="computeroutput"><a class="link" href="../boost/make_overloaded_function.html" title="Function template make_overloaded_function">boost::make_overloaded_function</a></code>
+ can be useful is when the overloaded function object is passed to a function
+ template which can hide the specific <code class="computeroutput"><a class="link" href="../boost/overloaded_function.html" title="Class template overloaded_function">boost::overloaded_function</a></code>
+ type using a template parameter. For example (see also identity.cpp
):
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">F</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">check</span><span class="special">(</span><span class="identifier">F</span> <span class="identifier">identity</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="string">"abc"</span><span class="special">)</span> <span class="special">==</span> <span class="string">"abc"</span> <span class="special">);</span>
+ <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">123</span><span class="special">)</span> <span class="special">==</span> <span class="number">123</span> <span class="special">);</span>
+ <span class="identifier">BOOST_CHECK</span><span class="special">(</span> <span class="identifier">identity</span><span class="special">(</span><span class="number">1.23</span><span class="special">)</span> <span class="special">==</span> <span class="number">1.23</span> <span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+</p>
+<pre class="programlisting"><span class="identifier">check</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_overloaded_function</span><span class="special">(</span><span class="identifier">identity_s</span><span class="special">,</span> <span class="identifier">identity_i</span><span class="special">,</span> <span class="identifier">identity_d</span><span class="special">));</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.boost_functional_overloadedfunction.Tutorial.overloading.f0" href="#boost_functional_overloadedfunction.Tutorial.overloading.f0" class="para">2</a>] </sup>
+ Function pointers are of the form <code class="literal"><span class="emphasis"><em>result-type </em></span></code><code class="computeroutput"><span class="special">(*)(</span></code><code class="literal"><span class="emphasis"><em>argument1-type</em></span></code><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code> (the
+ C++ compiler is usually able to automatically promote a function name to
+ a function pointer in a context where a function pointer is expected even
+ if the function name is not prefixed by <code class="computeroutput"><span class="special">&</span></code>).
+ Function references are of the form <code class="literal"><span class="emphasis"><em>result-type </em></span></code><code class="computeroutput"><span class="special">(&)(</span></code><code class="literal"><span class="emphasis"><em>argument1-type</em></span></code><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>.
+ Function types are of the form <code class="literal"><span class="emphasis"><em>result-type </em></span></code><code class="computeroutput"><span class="special">(</span></code><code class="literal"><span class="emphasis"><em>argument1-type</em></span></code><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code> (note
+ how they lack of both <code class="computeroutput"><span class="special">*</span></code> and
+ <code class="computeroutput"><span class="special">&</span></code> when compared to function
+ pointers and function references). Finally, monomorphic function objects
+ are instances of classes with a non-template call operator of the form
+ <code class="literal"><span class="emphasis"><em>result-type </em></span></code><code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span></code><code class="literal"><span class="emphasis"><em>argument1-type</em></span></code><code class="computeroutput"><span class="special">,</span> <span class="special">...)</span></code>.
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.boost_functional_overloadedfunction.Tutorial.overloading.f1" href="#boost_functional_overloadedfunction.Tutorial.overloading.f1" class="para">3</a>] </sup>
+ Note that in C++ the function result type is not used for overload resolution
+ (to avoid making the overload resolution context dependent). Therefore,
+ at least one of the function parameters must be distinct for each specified
+ function type.
+ </p></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 © 2011, 2012 Lorenzo Caminiti<p>
+ Distributed under the Boost Software License, Version 1.0 (see accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Getting_Started.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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>
Deleted: sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX.html
==============================================================================
--- sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
+++ (empty file)
@@ -1,57 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Macro BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX</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="Chapter 1. Boost.LocalFunction 1.0.0">
-<link rel="up" href="reference.html#header.boost.local_function.config_hpp" title="Header <boost/local_function/config.hpp>">
-<link rel="prev" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">
-<link rel="next" href="BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX.html" title="Macro BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX">
-</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">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><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_LOCAL_FUNCTION_CONFIG_BIND_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-<div class="refentry">
-<a name="BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX"></a><div class="titlepage"></div>
-<div class="refnamediv">
-<h2><span class="refentrytitle">Macro BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX</span></h2>
-<p>BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX — Maximum number of function parameters supported for the local functions. </p>
-</div>
-<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
-<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="reference.html#header.boost.local_function.config_hpp" title="Header <boost/local_function/config.hpp>">boost/local_function/config.hpp</a>>
-
-</span>BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX</pre></div>
-<div class="refsect1">
-<a name="id816692"></a><h2>Description</h2>
-<p>If programmers leave this configuration macro undefined, its default value is <code class="computeroutput">5</code>.</p>
-<p>This only applies to the number of local function parameters and not to the number of bound variables in scope (the limit on the number of bound variables is instead the maximum size allowed for a Boost.Preprocessor sequence).</p>
-<p><span class="bold"><strong>Warning:</strong></span> Increasing this number will increase compilation time.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="">Tutorial</a> section, {Getting_Started, Getting Started} section. </p>
-</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 © 2009-2012 Lorenzo
- Caminiti<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function.config_hpp"><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_LOCAL_FUNCTION_CONFIG_BIND_MAX.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>
Deleted: sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_END.html
==============================================================================
--- sandbox/local_function/libs/local_function/doc/html/BOOST_LOCAL_FUNCTION_END.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
+++ (empty file)
@@ -1,76 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Macro BOOST_LOCAL_FUNCTION_END</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="Chapter 1. Boost.LocalFunction 1.0.0">
-<link rel="up" href="reference.html#header.boost.local_function_hpp" title="Header <boost/local_function.hpp>">
-<link rel="prev" href="BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">
-<link rel="next" href="BOOST_LOCAL_FUNCTION_TYPEOF.html" title="Macro BOOST_LOCAL_FUNCTION_TYPEOF">
-</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">Home</td>
-<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
-<td align="center">More</td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><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_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-<div class="refentry">
-<a name="BOOST_LOCAL_FUNCTION_END"></a><div class="titlepage"></div>
-<div class="refnamediv">
-<h2><span class="refentrytitle">Macro BOOST_LOCAL_FUNCTION_END</span></h2>
-<p>BOOST_LOCAL_FUNCTION_END — This macro is used to specify the local function name. </p>
-</div>
-<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
-<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="reference.html#header.boost.local_function_hpp" title="Header <boost/local_function.hpp>">boost/local_function.hpp</a>>
-
-</span>BOOST_LOCAL_FUNCTION_END(qualified_function_name)</pre></div>
-<div class="refsect1">
-<a name="id858791"></a><h2>Description</h2>
-<p>This macro must follow the local function body code block <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput">BOOST_LOCAL_FUNCTION_PARAMS</code> documentation.</p>
-<p>The local function name can be prefixed by the "keyword" <code class="computeroutput">inline</code> (see the {Advanced_Topics, Advanced Topics} section): </p>
-<pre class="programlisting"> <span class="special">...</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">name</span><span class="special">)</span>
-</pre>
-<p> This increases the chances that the compiler will be able to inline the local function calls (thus reducing their run-time). However, inlined local functions cannot be passed as template parameters or assigned to other functors like <code class="computeroutput">boost::function</code> (that is true on C++03 compilers, see <code class="computeroutput">BOOST_LOCAL_CONFIG_COMPLIANT</code>, but inlined local functions can instead be passed as template parameters on C++11 compilers). On C++11 compilers, there is no need to declare a local function lined because this library will automatically use C++11 specific features to inline the local function while always allowing to pass it as a template parameter.</p>
-<p>The local function name can also be prefixed by the "keyword" <code class="computeroutput">recursive</code> (see the {Advanced_Topics, Advanced Topics} section): </p>
-<pre class="programlisting"> <span class="special">...</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">recursive</span> <span class="identifier">name</span><span class="special">)</span>
-</pre>
-<p> This allows the local function to recursively call itself from its body (as usual in C++). However, compilers have not been observed to be able to inline recursive local function calls (not even when the recursive local function is also declared inlined).</p>
-<p><span class="bold"><strong>Parameters:</strong></span> </p>
-<div class="informaltable"><table class="table">
-<colgroup>
-<col>
-<col>
-</colgroup>
-<tbody><tr>
-<td><span class="bold"><strong><code class="computeroutput">name</code></strong></span></td>
-<td>The name of the local function. The local function name can be prefixed by the "keyword" <code class="computeroutput">inline</code> to declare the local function inlined or by the "keyword" <code class="computeroutput">recursive</code> to declare the local function recursive (see the {Advanced_Topics, Advanced Topics} section). The local function name cannot be the name of an operator <code class="computeroutput">operator...</code> and it cannot be the same name of another local function declared within the same enclosing scope (use the <code class="computeroutput">boost::local::function::overload</code> functor to overload local functions, see the {Advanced_Topics, Advanced Topics} section). </td>
-</tr></tbody>
-</table></div>
-<p>
-</p>
-<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">BOOST_LOCAL_FUNCTION_PARAMS</code>, <a class="link" href="">Tutorial</a> section, {Advanced_Topics, Advanced Topics} section, <code class="computeroutput">BOOST_LOCAL_CONFIG_COMPLIANT</code>. </p>
-</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 © 2009-2012 Lorenzo
- Caminiti<p>
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- </p>
-</div></td>
-</tr></table>
-<hr>
-<div class="spirit-nav">
-<a accesskey="p" href="BOOST_LOCAL_FUNCTION_TPL.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="reference.html#header.boost.local_function_hpp"><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_LOCAL_FUNCTION_TYPEOF.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
-</div>
-</body>
-</html>
Added: sandbox/local_function/libs/local_function/example/test_impl_factorial.cpp
==============================================================================
--- (empty file)
+++ sandbox/local_function/libs/local_function/example/test_impl_factorial.cpp 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
@@ -0,0 +1,107 @@
+
+#include <boost/local_function.hpp>
+#define BOOST_TEST_MODULE TestImplFactorial
+#include <boost/test/unit_test.hppp>
+#include <vector>
+#include <algorithm>
+
+struct calculator {
+ std::vector<int> results;
+ void factorials(const std::vector<int>& nums) {
+ int // The local function result type (just before the `BOOST_LOCAL_FUNCTION_PARAMS` macro).
+
+ // *BEGIN* The macro
+ // BOOST_LOCAL_FUNCTION(bind this_, int num,
+ // bool recursion, default false)
+ // expands (at line/counter 19) to:
+
+ // DEDUCE RESULT TYPE
+ // Long name `ERROR_...` gives meaningful compiler-error message if
+ // programmers forget result type before the macro.
+ (*
+ ERROR_missing_result_type_before_the_local_function_parameter_macro_id19
+ )();
+ // Use Boost.ScopeExit type deduction technique (tagging, wrapping,
+ // struct, etc) so to work on all compilers (specifically, some GCC
+ // version give internal errors otherwise).
+ typedef void (*boost_local_function_auxXdeduce_result_tagX19X)(int
+ ERROR_missing_result_type_before_the_local_function_parameter_macro_id19
+ ) ;
+ typedef BOOST_TYPEOF(::boost::scope_exit::detail::wrap(
+ ::boost::scope_exit::detail::deref(
+ ERROR_missing_result_type_before_the_local_function_parameter_macro_id19,
+ (boost_local_function_auxXdeduce_result_tagX19X)0 ) ))
+ boost_local_function_auxXdeduce_result_wrapX19X ;
+ typedef boost_local_function_auxXdeduce_result_wrapX19X::type
+ boost_local_function_auxXdeduce_result_captureX19X ;
+ struct boost_local_function_auxXdeduce_result_paramsX19X {
+ typedef boost_local_function_auxXdeduce_result_captureX19X
+ function_ptr;
+ };
+ typedef ::boost::remove_pointer<
+ boost_local_function_auxXdeduce_result_paramsX19X::
+ function_ptr >::type
+ boost_local_function_auxXdeduce_result_function_typeX19X ;
+ typedef ::boost::function_traits<
+ boost_local_function_auxXdeduce_result_function_typeX19X
+ >::result_type
+ boost_local_function_auxXresult_typeX19X ;
+
+ // HANDLE BOUND VARIABLES
+ // Deduce bound variable types.
+#if BOSOT_WORKAROUND(BOOST_MSVC, >= 1300)
+ enum {
+ boost_se_this_type_indexX19X = sizeof(
+ *boost::scope_exit::msvc_typeof_this::encode_start(this))
+ };
+ typedef boost::scope_exit::msvc_typeof_this::msvc_typeid_wrapper<
+ boost::se_this_type_indexX19X>::type
+ boost_local_function_auxXthis_typeX19X;
+#else
+ typedef BOOST_TYPEOF(this) boost_local_function_auxXthis_typeX19X;
+#endif
+ // Store bound variables (by reference or value).
+ struct boost_se_params_t_19 {
+ boost_local_function_auxXthis_typeX19X
+ boost_local_function_auxXthis_varX;
+ } boost_local_function_auxXparamsX19X = { this };
+ // Set bound variables in variable `...args` without line/counter
+ // postfix so it can be accessed also by different macro NAME (so this
+ // variable must be declared using a template meta-programming thick
+ // that will declare it only once in each scope, no-op otherwise).
+ ::boost::scope_exit::detail::declared<
+ boost::scope_exit::detail::resolve<
+ sizeof(boost_local_function_auxXargsX)
+ >::cmp1<0>::cmp2
+ > boost_local_function_auxXargsX;
+ boost_local_function_auxXargsX.value =
+ &boost_local_function_auxXparamsX19X;
+
+ // LOCAL FUNCTOR
+ class boost_local_function_auxXfunctorX19X {
+ typedef boost_local_function_auxXresult_typeX19X
+ (boost_local_function_auxXfunction_typeX)
+ ( int num , bool recursion );
+ typedef boost::function_traits< void (
+ ::boost::local_function::aux::function<
+ boost_local_function_auxXfunction_typeX , 1 , boost_local_function_auxXthis_typeX19X , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t , ::boost::local_function::aux::nobind_t > ) >::arg1_type boost_local_function_auxXfunctor_typeX ; typedef boost_local_function_auxXthis_typeX19X this_Xtypeof_typeXboost_local_function_auxX ; public: enum { arity = ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arity }; typedef boost_local_function_auxXresult_typeX19X result_type; typedef ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg1_type arg1_type ; typedef ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg2_type arg2_type ; inline explicit boost_local_function
_auxXfunctorX19X( void* bind_params) : boost_local_function_auxXbind_thisX( static_cast< boost_se_params_t_19* >( bind_params)-> boost_local_function_auxXthis_varX ) { } inline boost_local_function_auxXresult_typeX19X operator()( ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg1_type >::param_type arg1 , ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg2_type >::param_type arg2 ) { return boost_local_function_auxXbodyX( boost_local_function_auxXbind_thisX , arg1 , arg2 ); } inline boost_local_function_auxXresult_typeX19X operator()( ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg1_type >::param_type arg1 ) { return boost_local_function_auxXbodyX( boost_local_function_auxXbind_thisX , arg1 ); } inline static boost_local_function_auxXresult_typeX19X boost_local_function_auxXcallX0X( void* object , boost_local_function_auxXthis_typeX19X & bind_this , ::boost::local_function::
aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg1_type >::param_type arg1 , ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg2_type >::param_type arg2 ) { return static_cast< boost_local_function_auxXfunctorX19X* >(object)-> boost_local_function_auxXbodyX( bind_this , arg1 , arg2 ) ; } inline static boost_local_function_auxXresult_typeX19X boost_local_function_auxXcallX1X( void* object , boost_local_function_auxXthis_typeX19X & bind_this , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t &
, ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::local_function::aux::nobind_t & , ::boost::call_traits< ::boost::function_traits< boost_local_function_auxXfunction_typeX >::arg1_type >::param_type arg1 ) { return static_cast< boost_local_function_auxXfunctorX19X* >(object)-> boost_local_function_auxXbodyX( bind_this , arg1 ) ; } inline static void boost_local_function_auxXinit_callX( void* object , boost_local_function_auxXfunctor_typeX& functor ) { functor.boost_local_function_auxXinit_callX( object , static_cast< boost_local_function_auxXfunctorX19X* >( object)->boost_local_function_auxXbind_thisX , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , :
:boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , ::boost::local_function::aux::nobind , &boost_local_function_auxXcallX0X , &boost_local_function_auxXcallX1X ); } private: boost_local_function_auxXthis_typeX19X boost_local_function_auxXbind_thisX ; boost::scope_exit::detail::undeclared boost_local_function_auxXargsX; inline boost_local_function_auxXresult_typeX19X boost_local_function_auxXbodyX( boost_local_function_auxXthis_typeX19X const this_ , int num , bool recursion = false ) {
+ int result = 0;
+ if(num <= 0) result = 1;
+ else result = num * factorial(num - 1, true);
+ if(!recursion) this_->results.push_back(result);
+ return result;
+ } public: boost_local_function_auxXfunctor_typeX factorial; inline void boost_local_function_auxXinit_recursionX( boost_local_function_auxXfunctor_typeX& functor) { factorial = functor; } } boost_local_function_auxXfactorialX(boost_local_function_auxXargsX.value); __typeof__(boost::type_of::ensure_obj(boost_local_function_auxXfactorialX. factorial)) factorial; boost_local_function_auxXfactorialX.boost_local_function_auxXinit_callX( &boost_local_function_auxXfactorialX, factorial); boost_local_function_auxXfactorialX.boost_local_function_auxXinit_recursionX( factorial);
+ std::for_each(nums.begin(), nums.end(), factorial);
+ }
+};
+
+BOOST_AUTO_TEST_CASE( test_impl_factorial ) {
+ std::vector<int> v(3);
+ v[0] = 1; v[1] = 3; v[2] = 4;
+ calculator calc;
+ calc.factorials(v);
+
+ BOOST_CHECK( cals.results[0] == 1 );
+ BOOST_CHECK( cals.results[1] == 6 );
+ BOOST_CHECK( cals.results[2] == 24 );
+}
Added: sandbox/local_function/libs/local_function/index.html
==============================================================================
--- (empty file)
+++ sandbox/local_function/libs/local_function/index.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <meta http-equiv="refresh" content="0; URL=doc/html/index.html">
+ </head>
+ <body>
+ Automatic redirection failed, click this
+ link <hr>
+ <p>© Copyright Lorenzo Caminiti, 2009-2012</p>
+ <p>Distributed under the Boost Software License, Version 1.0. (See
+ accompanying file <a href="../../../LICENSE_1_0.txt">
+ LICENSE_1_0.txt</a> or copy at
+ www.boost.org/LICENSE_1_0.txt)</p>
+ </body>
+</html>
Added: sandbox/local_function/libs/scope_exit/index.html
==============================================================================
--- (empty file)
+++ sandbox/local_function/libs/scope_exit/index.html 2012-01-31 19:05:17 EST (Tue, 31 Jan 2012)
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <meta http-equiv="refresh" content="0; URL=doc/html/index.html">
+ </head>
+ <body>
+ Automatic redirection failed, click this
+ link <hr>
+ <p>© Alexander Nasonov, Lorenzo Caminiti, 2006-2012</p>
+ <p>Distributed under the Boost Software License, Version 1.0. (See
+ accompanying file <a href="../../../LICENSE_1_0.txt">
+ LICENSE_1_0.txt</a> or copy at
+ www.boost.org/LICENSE_1_0.txt)</p>
+ </body>
+</html>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk