Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69846 - in sandbox/local: boost/local/aux_ libs/local/doc/html libs/local/doc/html/boost/local libs/local/doc/html/boost_local libs/local/doc/qbk libs/local/example
From: lorcaminiti_at_[hidden]
Date: 2011-03-11 09:33:25


Author: lcaminiti
Date: 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
New Revision: 69846
URL: http://svn.boost.org/trac/boost/changeset/69846

Log:
Migrating to new laptop.
Added:
   sandbox/local/libs/local/example/typeof_tpl_va.cpp (contents, props changed)
   sandbox/local/libs/local/example/typeof_va.cpp (contents, props changed)
Text files modified:
   sandbox/local/boost/local/aux_/function.hpp | 2
   sandbox/local/libs/local/doc/html/BOOST_IDENTITY_TYPE.html | 6
   sandbox/local/libs/local/doc/html/BOOST_IDENTITY_VALUE.html | 6
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_END.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html | 4
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_THIS_PARAM_NAME.html | 4
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_END.html | 2
   sandbox/local/libs/local/doc/html/boost/local/function.html | 6
   sandbox/local/libs/local/doc/html/boost_local/Advanced.html | 502 +++++++++++++++++++++++++++++++--------
   sandbox/local/libs/local/doc/html/boost_local/Alternatives.html | 5
   sandbox/local/libs/local/doc/html/boost_local/Starting.html | 8
   sandbox/local/libs/local/doc/html/boost_local/Tutorial.html | 97 ++++---
   sandbox/local/libs/local/doc/html/index.html | 8
   sandbox/local/libs/local/doc/html/reference.html | 2
   sandbox/local/libs/local/doc/qbk/advanced.qbk | 133 ++++++----
   sandbox/local/libs/local/doc/qbk/alternatives.qbk | 5
   sandbox/local/libs/local/doc/qbk/local.qbk | 4
   sandbox/local/libs/local/doc/qbk/starting.qbk | 2
   sandbox/local/libs/local/doc/qbk/tutorial.qbk | 22 +
   sandbox/local/libs/local/example/typeof_tpl.cpp | 2
   20 files changed, 588 insertions(+), 234 deletions(-)

Modified: sandbox/local/boost/local/aux_/function.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/function.hpp (original)
+++ sandbox/local/boost/local/aux_/function.hpp 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -34,7 +34,7 @@
     typename BOOST_LOCAL_AUX_arg_type(z, arg_n, unused)
                 
 #define BOOST_LOCAL_AUX_concrete_operator_call(z, defaults_n, arity) \
- inline R operator()(BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
+ R operator()(BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
                 BOOST_LOCAL_AUX_arg, ~)) const { \
         assert(ptr_); \
         return (*ptr_)(BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \

Modified: sandbox/local/libs/local/doc/html/BOOST_IDENTITY_TYPE.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_IDENTITY_TYPE.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_IDENTITY_TYPE.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,8 +33,8 @@
 
 </span>BOOST_IDENTITY_TYPE(parenthesized_type)</pre></div>
 <div class="refsect1">
-<a name="id900741"></a><h2>Description</h2>
-<p>This macro expands to an expression that can be passed as a single macro parameter even if it contains commas and that evaluates to the specified type at compile-time (see the <a class="link" href="boost_local/Advanced.html" title="Advanced">Advanced</a> section).</p>
+<a name="id908060"></a><h2>Description</h2>
+<p>This macro expands to an expression that can be passed as a single macro parameter even if it contains commas and that evaluates to the specified type at compile-time (see the <a class="link" href="boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section).</p>
 <p>For example <code class="computeroutput">BOOST_IDENTITY_TYPE((std::map&lt;int, double&gt;))</code> can be passed as a single macro parameter when instead <code class="computeroutput">std::map&lt;int, double&gt;</code> cannot (because it contains a comma not wrapped by round parenthesis so it will be interpreted as two separate macro parameters by the preprocessor).</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
@@ -49,7 +49,7 @@
 </table></div>
 <p>
 </p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Advanced.html" title="Advanced">Advanced</a> section. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/local/libs/local/doc/html/BOOST_IDENTITY_VALUE.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_IDENTITY_VALUE.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_IDENTITY_VALUE.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,8 +33,8 @@
 
 </span>BOOST_IDENTITY_VALUE(parenthesized_value)</pre></div>
 <div class="refsect1">
-<a name="id900882"></a><h2>Description</h2>
-<p>This macro expands to an expression that can be passed as a single macro parameter even if it contains commas and that evaluates to the specified value at run-time (see the <a class="link" href="boost_local/Advanced.html" title="Advanced">Advanced</a> section).</p>
+<a name="id908200"></a><h2>Description</h2>
+<p>This macro expands to an expression that can be passed as a single macro parameter even if it contains commas and that evaluates to the specified value at run-time (see the <a class="link" href="boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section).</p>
 <p>For example <code class="computeroutput">BOOST_IDENTITY_VALUE((key_size&lt;int, double&gt;::value))</code> can be passed as a single macro parameter when instead <code class="computeroutput">key_size&lt;int, double&gt;::value</code> cannot (because it contains a comma not wrapped by round parenthesis so it will be interpreted as two separate macro parameters by the preprocessor).</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">
@@ -49,7 +49,7 @@
 </table></div>
 <p>
 </p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Advanced.html" title="Advanced">Advanced</a> section. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_END.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_END.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_END.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_BLOCK_END</pre></div>
 <div class="refsect1">
-<a name="id898654"></a><h2>Description</h2>
+<a name="id905973"></a><h2>Description</h2>
 <p>This macro must follow the local block body code <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput">CONTRACT_DETAIL_LOCAL_BLOCK</code> documentation.</p>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_DETAIL_LOCAL_BLOCK</code>, <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. </p>
 </div>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,14 +33,14 @@
 
 </span>BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</pre></div>
 <div class="refsect1">
-<a name="id898787"></a><h2>Description</h2>
+<a name="id906105"></a><h2>Description</h2>
 <p><span class="bold"><strong>Note:</strong></span> If programmers leave this macro undefined, its default value is undefined.</p>
 <p>If this macro is defined, variadic macros and empty macro parameters are not supported. Variadic macros, are supported by most recent compilers (like MSVC and GCC) and they were first introduced by the C99 preprocessor. However, they are not part of the official ISO C++ standard.</p>
 <p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. Maximum number of function parameters supported for the local functions.</p>
 <p><span class="bold"><strong>Note:</strong></span> If programmers leave this macro undefined, its default value is <code class="computeroutput">5</code>.</p>
 <p>This only refers 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 sequences).</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="boost_local/Starting.html" title="Starting">Starting</a> section. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Starting.html" title="Getting Started">Starting</a> section. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_THIS_PARAM_NAME.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_THIS_PARAM_NAME.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_THIS_PARAM_NAME.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,10 +33,10 @@
 
 </span>BOOST_LOCAL_CONFIG_THIS_PARAM_NAME</pre></div>
 <div class="refsect1">
-<a name="id898920"></a><h2>Description</h2>
+<a name="id906239"></a><h2>Description</h2>
 <p><span class="bold"><strong>Note:</strong></span> If programmers leave this macro undefined, the default symbol used is <code class="computeroutput">this_</code>.</p>
 <p><span class="bold"><strong>Warning:</strong></span> Programmers should not define this macro unless it is absolutely necessary (e.g., to avoid name clashes with another library which cannot be changed). Changing the symbol <code class="computeroutput">this_</code> effectively changes the public API of this library.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Starting.html" title="Starting">Starting</a> section. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="boost_local/Starting.html" title="Getting Started">Starting</a> section. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_END.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_END.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_END.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_EXIT_END</pre></div>
 <div class="refsect1">
-<a name="id899144"></a><h2>Description</h2>
+<a name="id906463"></a><h2>Description</h2>
 <p>This macro must follow the local exit body code <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput">CONTRACT_DETAIL_LOCAL_EXIT</code> documentation.</p>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput">CONTRACT_DETAIL_LOCAL_EXIT</code>, <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. </p>
 </div>

Modified: sandbox/local/libs/local/doc/html/boost/local/function.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost/local/function.html (original)
+++ sandbox/local/libs/local/doc/html/boost/local/function.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -35,9 +35,9 @@
 <span class="keyword">struct</span> <a class="link" href="function.html" title="Struct template function">function</a> <span class="special">{</span>
 <span class="special">}</span><span class="special">;</span></pre></div>
 <div class="refsect1">
-<a name="id899480"></a><h2>Description</h2>
+<a name="id906798"></a><h2>Description</h2>
 <p>This template defines several specializations to handle a generic number <code class="computeroutput">N</code> of function parameters some of which can have default values. The number of supported function parameters goes from <code class="computeroutput">0</code> (for a function with no parameter) to a maximum of <code class="computeroutput"><a class="link" href="../../BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html" title="Macro BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX">BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</a></code>.</p>
-<p>Each template specialization defines call operators <code class="computeroutput">operator()(...)</code> with a different set of parameters to handle the number of default parameters specified by <code class="computeroutput">defaults</code> (see <a class="link" href="../../boost_local/Advanced.html" title="Advanced">Advanced</a> section): </p>
+<p>Each template specialization defines call operators <code class="computeroutput">operator()(...)</code> with a different set of parameters to handle the number of default parameters specified by <code class="computeroutput">defaults</code> (see <a class="link" href="../../boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section): </p>
 <pre class="programlisting"> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Result</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Arg1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ArgN</span><span class="special">,</span> <span class="identifier">size_t</span> <span class="identifier">defaults</span> <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span>
   <span class="keyword">class</span> <span class="identifier">function_ref</span><span class="special">&lt;</span><span class="identifier">Result</span> <span class="special">(</span><span class="identifier">Arg1</span><span class="special">,</span> <span class="special">...</span><span class="special">,</span> <span class="identifier">ArgN</span><span class="special">)</span><span class="special">,</span> <span class="identifier">defaults</span><span class="special">&gt;</span> <span class="special">{</span>
   <span class="keyword">public</span><span class="special">:</span>
@@ -83,7 +83,7 @@
 <p>
 </p>
 <p><span class="bold"><strong>Note:</strong></span> This template is similar to <code class="computeroutput">boost::function&lt;&gt;</code> but it also supports eventual default parameters.</p>
-<p><span class="bold"><strong>See:</strong></span> <a class="link" href="../../boost_local/Advanced.html" title="Advanced">Advanced</a> section, <code class="computeroutput"><a class="link" href="../../BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html" title="Macro BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX">BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</a></code>, <code class="computeroutput">BOOST_LOCAL_FUNCTION</code>, Boost.Function. </p>
+<p><span class="bold"><strong>See:</strong></span> <a class="link" href="../../boost_local/Advanced.html" title="Advanced Topics">Advanced</a> section, <code class="computeroutput"><a class="link" href="../../BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html" title="Macro BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX">BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</a></code>, <code class="computeroutput">BOOST_LOCAL_FUNCTION</code>, Boost.Function. </p>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/local/libs/local/doc/html/boost_local/Advanced.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Advanced.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Advanced.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -1,7 +1,7 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Advanced</title>
+<title>Advanced Topics</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="Boost.Local 0.1.1">
@@ -24,7 +24,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_local.Advanced"></a><a class="link" href="Advanced.html" title="Advanced">Advanced</a>
+<a name="boost_local.Advanced"></a><a class="link" href="Advanced.html" title="Advanced Topics">Advanced Topics</a>
 </h2></div></div></div>
 <div class="toc"><dl>
 <dt><span class="section"><a href="Advanced.html#boost_local.Advanced.commas_and_symbols_in_macro_parameters">Commas
@@ -53,13 +53,12 @@
       and Symbols in Macro Parameters</a>
 </h3></div></div></div>
 <p>
- The C++ preprocessor does not allow commas "<code class="computeroutput"><span class="special">,</span></code>"
+ The C++ preprocessor does not allow commas <code class="computeroutput"><span class="special">,</span></code>
         within macro parameters unless they are wrapped by the round parenthesis
         <code class="computeroutput"><span class="special">()</span></code>. Therefore, using commas
- the local function parameters and bindings passed to this library macros
- ill generate (cryptic) preprocessor errors unless they are wrapped within
- extra round parenthesis <code class="computeroutput"><span class="special">()</span></code> as
- explained here.
+ within the local function parameters and bindings will generate (cryptic)
+ preprocessor errors unless they are wrapped within extra round parenthesis
+ <code class="computeroutput"><span class="special">()</span></code> as explained here.
       </p>
 <div class="note"><table border="0" summary="Note">
 <tr>
@@ -83,7 +82,7 @@
 <p>
         In addition, local function parameter types cannot start with non-alphanumeric
         symbols (alphanumeric symbols are <code class="computeroutput"><span class="identifier">A</span><span class="special">-</span><span class="identifier">Z</span></code>, <code class="computeroutput"><span class="identifier">a</span><span class="special">-</span><span class="identifier">z</span></code>,
- and <code class="computeroutput"><span class="number">0</span><span class="special">-</span><span class="number">9</span></code>). <sup>[<a name="id880579" href="#ftn.id880579" class="footnote">15</a>]</sup> The library will generate (cryptic) preprocessor errors if a
+ and <code class="computeroutput"><span class="number">0</span><span class="special">-</span><span class="number">9</span></code>). <sup>[<a name="id880823" href="#ftn.id880823" class="footnote">15</a>]</sup> The library will generate (cryptic) preprocessor errors if a
         parameter type starts with a non-alphanumeric symbol.
       </p>
 <p>
@@ -111,13 +110,13 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;</span> <span class="identifier">m</span><span class="special">,</span> <span class="comment">// (1) Error.
 </span> <span class="special">::</span><span class="identifier">sign_t</span> <span class="identifier">sign</span><span class="special">,</span> <span class="comment">// (2) Error.
 </span> <span class="keyword">const</span> <span class="identifier">size_t</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">,</span> <span class="keyword">default</span>
             <span class="identifier">key_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">,</span> <span class="comment">// (3) Error.
 </span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">separator</span><span class="special">,</span> <span class="keyword">default</span> <span class="identifier">cat</span><span class="special">(</span><span class="string">":"</span><span class="special">,</span> <span class="string">" "</span><span class="special">),</span> <span class="comment">// (4) OK.
-</span><span class="special">)</span>
+</span><span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -126,13 +125,13 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><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">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;</span> <span class="identifier">m</span><span class="special">)</span> <span class="comment">// (1) Error.
 </span> <span class="special">(::</span><span class="identifier">sign_t</span> <span class="identifier">sign</span><span class="special">)</span> <span class="comment">// (2) Error.
 </span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_t</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">)(</span><span class="keyword">default</span>
             <span class="identifier">key_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">)</span> <span class="comment">// (3) Error.
 </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">&amp;</span> <span class="identifier">separator</span><span class="special">)(</span><span class="keyword">default</span> <span class="identifier">cat</span><span class="special">(</span><span class="string">":"</span><span class="special">,</span> <span class="string">" "</span><span class="special">))</span> <span class="comment">// (4) OK.
-</span><span class="special">)</span>
+</span><span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -141,12 +140,12 @@
 </table></div>
 <p>
         <span class="bold"><strong>(1)</strong></span> The parameter type <code class="computeroutput"><span class="keyword">const</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;</span></code> contains a comma "<code class="computeroutput"><span class="special">,</span></code>" after the first template parameter
- <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>. This comma is not wrapped by any
- round parenthesis <code class="computeroutput"><span class="special">()</span></code> (the outer
- parenthesis <code class="computeroutput"><span class="special">()</span></code> that make the
- sequencing macro syntax do not count) thus it will cause a preprocessor error.
- The macro <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a><span class="special">(</span></code><span class="emphasis"><em>parenthesized-type</em></span><code class="computeroutput"><span class="special">)</span></code> can be used to wrap a type within extra
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;</span></code> contains a comma <code class="computeroutput"><span class="special">,</span></code>
+ after the first template parameter <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>.
+ This comma is not wrapped by any round parenthesis <code class="computeroutput"><span class="special">()</span></code>
+ (the outer parenthesis <code class="computeroutput"><span class="special">()</span></code> that
+ make the sequencing macro syntax do not count) thus it will cause a preprocessor
+ error. The macro <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a><span class="special">(</span></code><span class="emphasis"><em>parenthesized-type</em></span><code class="computeroutput"><span class="special">)</span></code> can be used to wrap a type within extra
         parenthesis <code class="computeroutput"><span class="special">()</span></code> so to overcome
         this issue:
       </p>
@@ -172,10 +171,10 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;))</span> <span class="identifier">m</span><span class="special">,</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -184,10 +183,10 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">(</span><code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;&amp;))</span> <span class="identifier">m</span><span class="special">)</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -204,16 +203,17 @@
             macro.
           </li>
 <li class="listitem">
- Parenthesis to wrap the type expression (and therefore any commas "<code class="computeroutput"><span class="special">,</span></code>" that it contains) passed as parameter
+ Parenthesis to wrap the type expression (and therefore any commas <code class="computeroutput"><span class="special">,</span></code> that it contains) passed as parameter
             to the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- macro. <sup>[<a name="id881869" href="#ftn.id881869" class="footnote">16</a>]</sup>
+ macro. <sup>[<a name="id882181" href="#ftn.id882181" class="footnote">16</a>]</sup>
           </li>
 </ol></div>
 <p>
         <span class="bold"><strong>(2)</strong></span> The parameter type <code class="computeroutput"><span class="special">::</span><span class="identifier">sign_t</span></code> start with the non-alphanumeric
- symbols "<code class="computeroutput"><span class="special">::</span></code>" thus
- it cannot be used by the parenthesized syntax. The macros <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code> can also
- be used to overcome these issue:
+ symbols <code class="computeroutput"><span class="special">::</span></code> thus it will generate
+ preprocessor errors if used as a local function parameter type. The macros
+ <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
+ can also be used to overcome this issue:
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -237,11 +237,11 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
     <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((::</span><span class="identifier">sign_t</span><span class="special">))</span> <span class="identifier">sign</span><span class="special">,</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -250,11 +250,11 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
     <span class="special">(</span><code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((::</span><span class="identifier">sign_t</span><span class="special">))</span> <span class="identifier">sign</span><span class="special">)</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -263,9 +263,10 @@
 </table></div>
 <p>
         Often, there might be better ways to overcome this limitation that lead to
- code which is more readable than the one using these macros. For example,
- in this case the symbol "<code class="computeroutput"><span class="special">::</span></code>"
- could be simply dropped to obtain the following and more readable code:
+ code which is more readable than the one using the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
+ macro. For example, in this case the symbols <code class="computeroutput"><span class="special">::</span></code>
+ could have been simply dropped to obtain the following valid and more readable
+ code:
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -289,11 +290,11 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
- <span class="identifier">sign_t</span> <span class="identifier">sign</span><span class="special">,</span> <span class="comment">// OK.
+ <span class="identifier">sign_t</span> <span class="identifier">sign</span><span class="special">,</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -302,11 +303,11 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
     <span class="special">(</span><span class="identifier">sign_t</span> <span class="identifier">sign</span><span class="special">)</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -315,11 +316,11 @@
 </table></div>
 <p>
         <span class="bold"><strong>(3)</strong></span> The default parameter value <code class="computeroutput"><span class="identifier">key_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;::</span><span class="identifier">value</span></code>
- contains a comma "<code class="computeroutput"><span class="special">,</span></code>"
- after the first template parameter <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>.
+ contains a comma <code class="computeroutput"><span class="special">,</span></code> after the
+ first template parameter <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>.
         Again, this comma is not wrapped by any parenthesis <code class="computeroutput"><span class="special">()</span></code>
         so it will cause a preprocessor error. Because this is a value expression
- (and not a type expression), it can simply be wrapped within an extra set
+ (and not a type expression), it can be simply wrapped within an extra set
         of round parenthesis <code class="computeroutput"><span class="special">()</span></code>:
       </p>
 <div class="informaltable"><table class="table">
@@ -344,12 +345,12 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
     <span class="keyword">const</span> <span class="identifier">size_t</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">,</span> <span class="keyword">default</span>
             <span class="special">(</span><span class="identifier">key_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">),</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -358,12 +359,12 @@
                 <p>
                   
 </p>
-<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
     <span class="special">...</span>
     <span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_t</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">)(</span><span class="keyword">default</span>
             <span class="special">(</span><span class="identifier">key_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">))</span> <span class="comment">// OK.
 </span> <span class="special">...</span>
-<span class="special">)</span>
+<span class="special">)</span> <span class="special">...</span>
 </pre>
 <p>
                 </p>
@@ -376,24 +377,36 @@
 <th align="left">Note</th>
 </tr>
 <tr><td align="left" valign="top"><p>
- Alternatively, the macro <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_VALUE.html" title="Macro BOOST_IDENTITY_VALUE">BOOST_IDENTITY_VALUE</a><span class="special">(</span></code><span class="emphasis"><em>parenthesized-value</em></span><code class="computeroutput"><span class="special">)</span></code> could have been equivalently used. This
- macro expands to an expression that evaluates (at run-time) exactly to
- the specified value (but it adds overhead compared with simply using the
- extra parenthesis <code class="computeroutput"><span class="special">()</span></code>). Note
- that, similarly to <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>,
+ Alternatively, the macro <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_VALUE.html" title="Macro BOOST_IDENTITY_VALUE">BOOST_IDENTITY_VALUE</a><span class="special">(</span></code><span class="emphasis"><em>parenthesized-value</em></span><code class="computeroutput"><span class="special">)</span></code> could have been used. This macro expands
+ to an expression that evaluates (at run-time) exactly to the specified
+ value -- but it adds overhead compared with simply using the extra parenthesis
+ <code class="computeroutput"><span class="special">()</span></code>. Note that, similarly to
+ <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>,
           the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_VALUE.html" title="Macro BOOST_IDENTITY_VALUE">BOOST_IDENTITY_VALUE</a></code>
           macro also requires two sets of extra parenthesis one set for invoking
- the macro and another set to wrap the value.
+ the macro and another set to wrap the value expression passed as the macro
+ parameter.
         </p></td></tr>
 </table></div>
 <p>
- <span class="bold"><strong>(4)</strong></span> The default parameter value <code class="computeroutput"><span class="identifier">cat</span><span class="special">(</span><span class="char">':'</span><span class="special">,</span> <span class="char">' '</span><span class="special">)</span></code>
- is instead fine because it contains a comma "<code class="computeroutput"><span class="special">,</span></code>"
- which is already wrapped by the parenthesis <code class="computeroutput"><span class="special">()</span></code>
- of the function call <code class="computeroutput"><span class="identifier">cat</span><span class="special">(...)</span></code>.
+ <span class="bold"><strong>(4)</strong></span> The default parameter value <code class="computeroutput"><span class="identifier">cat</span><span class="special">(</span><span class="string">":"</span><span class="special">,</span> <span class="string">" "</span><span class="special">)</span></code> is instead fine because it contains a comma
+ <code class="computeroutput"><span class="special">,</span></code> which is already wrapped by
+ the parenthesis <code class="computeroutput"><span class="special">()</span></code> of the function
+ call <code class="computeroutput"><span class="identifier">cat</span><span class="special">(...)</span></code>.
       </p>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
+ macro must be prefixed by the <code class="computeroutput"><span class="keyword">typename</span></code>
+ keyword when used within templates.
+ </p></td></tr>
+</table></div>
 <p>
- Consider the following complete example: <sup>[<a name="id883052" href="#ftn.id883052" class="footnote">17</a>]</sup>
+ Consider the following complete example: <sup>[<a name="id883486" href="#ftn.id883486" class="footnote">17</a>]</sup>
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -501,16 +514,306 @@
               </td>
 </tr></tbody>
 </table></div>
-<p>
- The <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- macro must be prefixed by the <code class="computeroutput"><span class="keyword">typename</span></code>
- keyword when used within templates.
- </p>
 </div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
 <a name="boost_local.Advanced.deducing_bound_types"></a><a class="link" href="Advanced.html#boost_local.Advanced.deducing_bound_types" title="Deducing Bound Types">Deducing Bound
       Types</a>
-</h3></div></div></div></div>
+</h3></div></div></div>
+<p>
+ While the ISO C++ standard does not allow for member functions of local classes
+ to have template parameters, this library allows to call template functions
+ from within a local function, a local block, or a local exit passing bound
+ variables without explicitly specifying their types. This essentially allows
+ local functions, local blocks, and local exits to be polymorphic
+ in the type of the bound variables (like a template is polymorphic in the
+ type of its template parameters).
+ </p>
+<p>
+ Furthermore, this library allow to access the type of the bound variables
+ from within the local function, local block, or local exit using the following
+ macro:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="special">...</span> <span class="comment">// Within a local function, local block, or local exit.
+</span><code class="computeroutput">BOOST_LOCAL_TYPEOF</code><span class="special">(</span><span class="emphasis"><em>bound-variable</em></span><span class="special">)</span> <span class="special">...</span>
+<span class="special">...</span>
+</pre>
+<p>
+ This macro expands to a type expression that evaluates (at compile-time)
+ to the fully qualified type of the specified bound variable. This type expression
+ is fully qualified in the sense that it will be constant if the variable
+ is bound by constant and it will also be a reference is the variable is bound
+ by reference (if needed, programmers can strip away the <code class="computeroutput"><span class="keyword">const</span></code>
+ and <code class="computeroutput"><span class="special">&amp;</span></code> qualifiers using
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span></code> and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span></code>,
+ or similar template metafunctions).
+ </p>
+<p>
+ For example:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Variadic Macro Syntax (C99 and later compilers)
+ </p>
+ </th>
+<th>
+ <p>
+ Sequencing Macro Syntax (all C++ compilers)
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Typeof header.
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">algorithm</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cassert</span><span class="special">&gt;</span>
+
+<span class="keyword">double</span> <span class="identifier">total</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">();</span>
+ <span class="keyword">int</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="keyword">double</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">num</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span>
+ <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">factor</span><span class="special">)</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">factor</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">f</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="identifier">add</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+ <span class="keyword">double</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="keyword">double</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
+ <span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">size</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">s</span> <span class="special">&amp;&amp;</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
+
+ <span class="identifier">nums</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span>
+
+ <span class="identifier">BOOST_LOCAL_BLOCK</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="special">&amp;</span><span class="identifier">sum</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Typeof qualified with eventual bind's `const` and `&amp;`.
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">s</span><span class="special">;</span>
+ <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">sum</span><span class="special">;</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span> <span class="special">+</span> <span class="identifier">z</span><span class="special">));</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
+
+ <span class="keyword">return</span> <span class="identifier">sum</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">total</span><span class="special">(</span><span class="number">100.0</span><span class="special">,</span> <span class="number">90.5</span><span class="special">,</span> <span class="number">7.0</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Typeof header.
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">algorithm</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cassert</span><span class="special">&gt;</span>
+
+<span class="keyword">double</span> <span class="identifier">total</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">double</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">();</span>
+ <span class="keyword">int</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="keyword">double</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">factor</span><span class="special">)</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">factor</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">f</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="identifier">add</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+ <span class="keyword">double</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="keyword">double</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
+ <span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">size</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">size</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">s</span> <span class="special">&amp;&amp;</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
+
+ <span class="identifier">nums</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span>
+
+ <span class="identifier">BOOST_LOCAL_BLOCK</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="special">&amp;</span><span class="identifier">sum</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Typeof qualified with eventual bind's `const` and `&amp;`.
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">s</span><span class="special">;</span>
+ <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">sum</span><span class="special">;</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span> <span class="special">+</span> <span class="identifier">z</span><span class="special">));</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
+
+ <span class="keyword">return</span> <span class="identifier">sum</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">total</span><span class="special">(</span><span class="number">100.0</span><span class="special">,</span> <span class="number">90.5</span><span class="special">,</span> <span class="number">7.0</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<p>
+ Within templates, <code class="computeroutput">BOOST_LOCAL_TYPEOF</code>
+ does not require to be prefixed by the <code class="computeroutput"><span class="keyword">typename</span></code>
+ keyword but eventual type manipulations need the <code class="computeroutput"><span class="keyword">typename</span></code>
+ prefix as usual:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Variadic Macro Syntax (C99 and later compilers)
+ </p>
+ </th>
+<th>
+ <p>
+ Sequencing Macro Syntax (all C++ compilers)
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Typeof header.
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">algorithm</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cassert</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">T</span> <span class="identifier">total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">T</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">();</span>
+ <span class="keyword">int</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="identifier">T</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS_TPL</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">num</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">,</span>
+ <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">factor</span><span class="special">)</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">factor</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">f</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="identifier">add</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+ <span class="identifier">T</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">T</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
+ <span class="identifier">BOOST_LOCAL_EXIT_TPL</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">size</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">s</span> <span class="special">&amp;&amp;</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
+
+ <span class="identifier">nums</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span>
+
+ <span class="identifier">BOOST_LOCAL_BLOCK_TPL</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="special">&amp;</span><span class="identifier">sum</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Typeof qualified with eventual bind's `const` and `&amp;`.
+</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">s</span><span class="special">;</span>
+ <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">sum</span><span class="special">;</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span> <span class="special">+</span> <span class="identifier">z</span><span class="special">));</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
+
+ <span class="keyword">return</span> <span class="identifier">sum</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">total</span><span class="special">(</span><span class="number">100.0</span><span class="special">,</span> <span class="number">90.5</span><span class="special">,</span> <span class="number">7.0</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// Typeof header.
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">algorithm</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cassert</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="identifier">T</span> <span class="identifier">total</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">T</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">();</span>
+ <span class="keyword">int</span> <span class="identifier">factor</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="identifier">T</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS_TPL</span><span class="special">(</span> <span class="special">(</span><span class="identifier">T</span> <span class="identifier">num</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">factor</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">sum</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">factor</span><span class="special">)</span> <span class="identifier">f</span> <span class="special">=</span> <span class="identifier">factor</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">sum</span> <span class="special">+=</span> <span class="identifier">f</span> <span class="special">*</span> <span class="identifier">num</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">add</span><span class="special">)</span>
+ <span class="identifier">add</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
+
+ <span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
+ <span class="identifier">T</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">T</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
+ <span class="identifier">BOOST_LOCAL_EXIT_TPL</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">size</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">size</span><span class="special">)</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">size</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">s</span> <span class="special">&amp;&amp;</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
+
+ <span class="identifier">nums</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">y</span><span class="special">;</span> <span class="identifier">nums</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">z</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">,</span> <span class="identifier">nums</span> <span class="special">+</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">add</span><span class="special">);</span>
+
+ <span class="identifier">BOOST_LOCAL_BLOCK_TPL</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="special">&amp;</span><span class="identifier">sum</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">factor</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// Typeof qualified with eventual bind's `const` and `&amp;`.
+</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span>
+ <span class="identifier">BOOST_LOCAL_TYPEOF</span><span class="special">(</span><span class="identifier">sum</span><span class="special">)&gt;::</span><span class="identifier">type</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">s</span><span class="special">;</span>
+ <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">sum</span><span class="special">;</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">factor</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span> <span class="special">+</span> <span class="identifier">z</span><span class="special">));</span>
+ <span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
+
+ <span class="keyword">return</span> <span class="identifier">sum</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">total</span><span class="special">(</span><span class="number">100.0</span><span class="special">,</span> <span class="number">90.5</span><span class="special">,</span> <span class="number">7.0</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
 <div class="section">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_local.Advanced.passing_local_functions"></a><a class="link" href="Advanced.html#boost_local.Advanced.passing_local_functions" title="Passing Local Functions">Passing
@@ -529,7 +832,7 @@
           Local functions are never copied by value. You can only obtain a reference
           to a local function therefore you need to make sure that the <span class="bold"><strong>local function survives the scope of its reference</strong></span>
           otherwise the reference will be invalid and its use will generate a run-time
- error (as usual with C++ references). <sup>[<a name="id886296" href="#ftn.id886296" class="footnote">18</a>]</sup>
+ error (as usual with C++ references). <sup>[<a name="id893596" href="#ftn.id893596" class="footnote">18</a>]</sup>
         </p></td></tr>
 </table></div>
 <p>
@@ -723,11 +1026,10 @@
 </tr></tbody>
 </table></div>
 <p>
- In addition, a local function can be bind and call another local function.
- For example, the following local function <code class="computeroutput"><span class="identifier">inc_sum</span></code>
+ In addition, a local function can bind and call another local function. For
+ example, the following local function <code class="computeroutput"><span class="identifier">inc_sum</span></code>
         binds the local function <code class="computeroutput"><span class="identifier">inc</span></code>
- so the <code class="computeroutput"><span class="identifier">inc_sum</span></code> can call
- <code class="computeroutput"><span class="identifier">inc</span></code>:
+ so <code class="computeroutput"><span class="identifier">inc_sum</span></code> can call <code class="computeroutput"><span class="identifier">inc</span></code>:
       </p>
 <div class="informaltable"><table class="table">
 <colgroup>
@@ -776,7 +1078,7 @@
 
     <span class="comment">// v = ++(v + w) + 0 = 27 47 67 87 107
 </span> <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">j</span><span class="special">,</span>
- <span class="identifier">bind</span> <span class="identifier">inc</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Bind another local function.
+ <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">inc</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Bind another local function.
 </span> <span class="keyword">return</span> <span class="identifier">inc</span><span class="special">(</span><span class="identifier">i</span> <span class="special">+</span> <span class="identifier">j</span><span class="special">);</span> <span class="comment">// Call the bound local function.
 </span> <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">inc_sum</span><span class="special">)</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">transform</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">w</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">inc_sum</span><span class="special">);</span>
@@ -820,7 +1122,7 @@
 
     <span class="comment">// v = ++(v + w) + 0 = 27 47 67 87 107
 </span> <span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">j</span><span class="special">)</span>
- <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">inc</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Bind another local function.
+ <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">inc</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Bind another local function.
 </span> <span class="keyword">return</span> <span class="identifier">inc</span><span class="special">(</span><span class="identifier">i</span> <span class="special">+</span> <span class="identifier">j</span><span class="special">);</span> <span class="comment">// Call the bound local function.
 </span> <span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">inc_sum</span><span class="special">)</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">transform</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">w</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">inc_sum</span><span class="special">);</span>
@@ -916,9 +1218,6 @@
         </p></td></tr>
 </table></div>
 <p>
- For example:
- </p>
-<p>
         
 </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@@ -1003,14 +1302,14 @@
         to usual features of C++ functions.
       </p>
 <a name="boost_local.Advanced.limitations__overloading_and_operators.overloading"></a><h6>
-<a name="id895860"></a>
+<a name="id903180"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading_and_operators.overloading">Overloading</a>
       </h6>
 <p>
         It is not possible to overload local functions. Declaring multiple local
         functions with the same name within the same enclosing scope generates a
         compile-time error (even if the different declarations specify different
- parameters). <sup>[<a name="id895879" href="#ftn.id895879" class="footnote">19</a>]</sup>
+ parameters). <sup>[<a name="id903199" href="#ftn.id903199" class="footnote">19</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -1033,12 +1332,12 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading_and_operators.nesting"></a><h6>
-<a name="id896320"></a>
+<a name="id903640"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading_and_operators.nesting">Nesting</a>
       </h6>
 <p>
         It is not possible to nest local functions, local blocks, or local exits
- within each other. Nesting will generate a compile-time error. <sup>[<a name="id896342" href="#ftn.id896342" class="footnote">20</a>]</sup>
+ within each other. Nesting will generate a compile-time error. <sup>[<a name="id903662" href="#ftn.id903662" class="footnote">20</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -1061,12 +1360,12 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading_and_operators.operators"></a><h6>
-<a name="id896744"></a>
+<a name="id904064"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading_and_operators.operators">Operators</a>
       </h6>
 <p>
         Local functions cannot be operators. Naming a local function <code class="computeroutput"><span class="keyword">operator</span><span class="special">...</span></code>
- will generate a compile-time error. <sup>[<a name="id896780" href="#ftn.id896780" class="footnote">21</a>]</sup>
+ will generate a compile-time error. <sup>[<a name="id904100" href="#ftn.id904100" class="footnote">21</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -1088,7 +1387,7 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading_and_operators.etc"></a><h6>
-<a name="id897173"></a>
+<a name="id904493"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading_and_operators.etc">Etc</a>
       </h6>
 <p>
@@ -1219,7 +1518,7 @@
               </td>
 <td>
                 <p>
- This is supported (see the <a class="link" href="Advanced.html" title="Advanced">Advanced</a>
+ This is supported (see the <a class="link" href="Advanced.html" title="Advanced Topics">Advanced</a>
                   section).
                 </p>
               </td>
@@ -1320,7 +1619,7 @@
                 <p>
                   This is supported but it cannot be overloaded and it cannot be
                   an operator (see the <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a>
- and <a class="link" href="Advanced.html" title="Advanced">Advanced</a> sections).
+ and <a class="link" href="Advanced.html" title="Advanced Topics">Advanced</a> sections).
                 </p>
               </td>
 </tr>
@@ -1341,7 +1640,7 @@
                   and <code class="computeroutput"><span class="keyword">register</span></code> parameter
                   classifiers, default parameters, and binding of variables in scope
                   (see the <a class="link" href="Tutorial.html" title="Tutorial">Tutorial</a> and
- <a class="link" href="Advanced.html" title="Advanced">Advanced</a> sections).
+ <a class="link" href="Advanced.html" title="Advanced Topics">Advanced</a> sections).
                 </p>
                 <p>
                   In addition, the parenthesized syntax could support named parameters
@@ -1393,47 +1692,48 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id880579" href="#id880579" class="para">15</a>] </sup>
- <span class="bold"><strong>Rationale.</strong></span> This limitation cames from
- the implementation of the library parsing macros that use preprocessor
- token concatenation to inspect the parameter type token to see if the token
- is a parameter or a bound variable. The C++ preprocessor does not allow
- to concatenate non-alphanumeric tokens.
+<div class="footnote"><p><sup>[<a id="ftn.id880823" href="#id880823" class="para">15</a>] </sup>
+ <span class="bold"><strong>Rationale.</strong></span> This limitation derives from
+ the fact that <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code>
+ uses preprocessor token concatenation to inspect the parameter type token
+ to see if the token is a parameter or a bound variable. The C++ preprocessor
+ does not allow to concatenate non-alphanumeric tokens.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id881869" href="#id881869" class="para">16</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id882181" href="#id882181" class="para">16</a>] </sup>
               <span class="bold"><strong>Rationale.</strong></span> Using variadic macros,
               this extra set of parenthesis could be eliminated requiring only the
               parenthesis to invoke the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- macro. This feature is currently not implemented and the double parenthesis
- are always needed when invoking this macro.
+ macro. However, this feature is currently not implemented and the double
+ parenthesis are always needed when invoking this macro.
             </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id883052" href="#id883052" class="para">17</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id883486" href="#id883486" class="para">17</a>] </sup>
           The authors recognize that the use of the <span class="emphasis"><em>identity macros</em></span>
           adds extra parenthesis to the already significant number of parenthesis
- required by the parenthesized syntax. However, macro parameters usually
- do not contain unwrapped commas "<code class="computeroutput"><span class="special">,</span></code>"
- (unless template metaprogramming is being used).
+ required by the sequencing macro syntax. However, macro parameters usually
+ do not contain unwrapped commas <code class="computeroutput"><span class="special">,</span></code>
+ (unless template metaprogramming is being used) so this is usually not
+ a problem.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id886296" href="#id886296" class="para">18</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id893596" href="#id893596" class="para">18</a>] </sup>
             The suffix <code class="computeroutput"><span class="identifier">ref</span></code> of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">local</span><span class="special">::</span><a class="link" href="../boost/local/function.html" title="Struct template function">function</a></code> is meant to
             help programmers remember that they are dealing with references to (and
             not copies of) local functions.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id895879" href="#id895879" class="para">19</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id903199" href="#id903199" class="para">19</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This is because a local function
           is a functor object declared as a local variable within the enclosing scope.
           Therefore, declaring two local functions with the same name within the
           same enclosing scope declares two local variables with the same name within
           the same scope and that is not allowed in C++.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id896342" href="#id896342" class="para">20</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id903662" href="#id903662" class="para">20</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This is because within a nested
           code block only global or static variables can be accessed while Boost.ScopeExit
           variable <a href="http://lists.boost.org/Archives/boost/2006/11/113658.php" target="_top">binding
           mechanism</a> requires to access local variables that hold the bound
           variables.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id896780" href="#id896780" class="para">21</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id904100" href="#id904100" class="para">21</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This is the because a local
           function name must be a valid local variable name (the local variable to
           hold the local functor object) and operators cannot be used as local variable

Modified: sandbox/local/libs/local/doc/html/boost_local/Alternatives.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Alternatives.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Alternatives.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -42,6 +42,11 @@
 <p>
         The following table compares local function features.
       </p>
+<p>
+ @todo From Mathias: Minus of Local compared to Lambdas: - creating a local
+ can only be done at statement scope. - locals may not automatically capture
+ all context - size of a local function cannot be optimized to be two words.
+ </p>
 <div class="informaltable"><table class="table">
 <colgroup>
 <col>

Modified: sandbox/local/libs/local/doc/html/boost_local/Starting.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Starting.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Starting.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -1,7 +1,7 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Starting</title>
+<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="Boost.Local 0.1.1">
@@ -24,7 +24,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_local.Starting"></a><a class="link" href="Starting.html" title="Starting">Starting</a>
+<a name="boost_local.Starting"></a><a class="link" href="Starting.html" title="Getting Started">Getting Started</a>
 </h2></div></div></div>
 <div class="toc"><dl>
 <dt><span class="section">This Documentation</span></dt>
@@ -53,7 +53,7 @@
             provides an overview on the library and its features.
           </li>
 <li class="listitem">
- The <a class="link" href="Starting.html" title="Starting">Starting</a> section explains
+ The <a class="link" href="Starting.html" title="Getting Started">Starting</a> section explains
             how to read this documentation, how to install the library to work with
             the supported compilers and platforms.
           </li>
@@ -68,7 +68,7 @@
       </p>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
- The <a class="link" href="Advanced.html" title="Advanced">Advanced</a> section explains
+ The <a class="link" href="Advanced.html" title="Advanced Topics">Advanced</a> section explains
             advanced usages of the library.
           </li>
 <li class="listitem">

Modified: sandbox/local/libs/local/doc/html/boost_local/Tutorial.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Tutorial.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Tutorial.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -6,8 +6,8 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="../index.html" title="Boost.Local 0.1.1">
 <link rel="up" href="../index.html" title="Boost.Local 0.1.1">
-<link rel="prev" href="Starting.html" title="Starting">
-<link rel="next" href="Advanced.html" title="Advanced">
+<link rel="prev" href="Starting.html" title="Getting Started">
+<link rel="next" href="Advanced.html" title="Advanced Topics">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -49,13 +49,14 @@
         to <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++0x
         lambda</a> functions which can instead be declared within expressions):
       </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context.
-</span> <span class="special">...</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
+<span class="special">...</span>
+<span class="special">{</span> <span class="comment">// Some declarative context.
+</span> <span class="special">...</span>
     <span class="emphasis"><em>result-type</em></span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span><span class="emphasis"><em>parameters</em></span><span class="special">)</span> <span class="special">{</span>
         <span class="emphasis"><em>body-code</em></span>
     <span class="special">}</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code><span class="special">(</span><span class="emphasis"><em>name</em></span><span class="special">)</span>
-
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
@@ -114,12 +115,12 @@
         <span class="special">...</span> <span class="special">}</span></code>
         using the usual C++ syntax. The body is specified outside any of the macros
         so eventual compiler error messages and line numbers retain their usual meaning.
- <sup>[<a name="id865988" href="#ftn.id865988" class="footnote">3</a>]</sup>
+ <sup>[<a name="id866036" href="#ftn.id866036" class="footnote">3</a>]</sup>
       </p>
 <p>
         The macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
         is used to end the local function definition and to specify the local function
- name. <sup>[<a name="id866018" href="#ftn.id866018" class="footnote">4</a>]</sup>
+ name. <sup>[<a name="id866072" href="#ftn.id866072" class="footnote">4</a>]</sup>
       </p>
 <p>
         For example, let's program a local function named <code class="computeroutput"><span class="identifier">add</span></code>
@@ -365,7 +366,7 @@
         This library also allows to specify default values for the local function
         parameters. However, the usual C++ syntax for default parameters that uses
         the assignment symbol <code class="computeroutput"><span class="special">=</span></code> cannot
- be used. <sup>[<a name="id867944" href="#ftn.id867944" class="footnote">5</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
+ be used. <sup>[<a name="id867998" href="#ftn.id867998" class="footnote">5</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
         is used instead:
       </p>
 <div class="informaltable"><table class="table">
@@ -468,10 +469,18 @@
         <code class="computeroutput"><span class="identifier">WITH_DEFAULT</span></code> macro similar
         to the following if they think it improves readability:
       </p>
-<p>
-
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th>
+ <p>
+ Variadic Macro Syntax (C99 and later compilers)
+ </p>
+ </th></tr></thead>
+<tbody><tr><td>
+ <p>
+
 </p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
 
 <span class="preprocessor">#define</span> <span class="identifier">WITH_DEFAULT</span> <span class="special">,</span> <span class="keyword">default</span>
@@ -486,7 +495,9 @@
 <span class="special">}</span>
 </pre>
 <p>
- </p>
+ </p>
+ </td></tr></tbody>
+</table></div>
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h3 class="title">
@@ -497,7 +508,7 @@
         variables, the object <code class="computeroutput"><span class="keyword">this</span></code>,
         etc) can be bound to a local function declaration. The types of bound variables
         are automatically deduced by this library using Boost.Typeof.
- <sup>[<a name="id869130" href="#ftn.id869130" class="footnote">6</a>]</sup>
+ <sup>[<a name="id869232" href="#ftn.id869232" class="footnote">6</a>]</sup>
       </p>
 <div class="important"><table border="0" summary="Important">
 <tr>
@@ -514,7 +525,7 @@
 </table></div>
 <p>
         This library introduces the new "keyword" <code class="computeroutput"><span class="identifier">bind</span></code>
- <sup>[<a name="id869215" href="#ftn.id869215" class="footnote">7</a>]</sup> which is used in place of the parameter type to specify the name
+ <sup>[<a name="id869327" href="#ftn.id869327" class="footnote">7</a>]</sup> which is used in place of the parameter type to specify the name
         of a variable in scope to bind. The variable can be bound by value:
       </p>
 <pre class="programlisting"><span class="identifier">bind</span> <span class="emphasis"><em>variable-name</em></span> <span class="comment">// Bind by value.
@@ -555,7 +566,7 @@
         unless constant binding is forced using <code class="computeroutput"><span class="keyword">const</span>
         <span class="identifier">bind</span> <span class="special">...</span></code>
         (note that binding by constant reference is not supported by <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++0x
- lambda</a> functions). <sup>[<a name="id869470" href="#ftn.id869470" class="footnote">8</a>]</sup> Programmers might want to bind variables of complex types by
+ lambda</a> functions). <sup>[<a name="id869592" href="#ftn.id869592" class="footnote">8</a>]</sup> Programmers might want to bind variables of complex types by
         (constant) reference instead than by value to avoid expensive copy operations
         when these variables are automatically passed to the local function (as usual
         with C++ function parameter passing).
@@ -636,7 +647,7 @@
 </tr></tbody>
 </table></div>
 <a name="boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_"></a><h6>
-<a name="id870457"></a>
+<a name="id870581"></a>
         <a class="link" href="Tutorial.html#boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_">Binding
         the Object <code class="computeroutput"><span class="keyword">this</span></code></a>
       </h6>
@@ -690,12 +701,12 @@
           to a local function, the local function <span class="bold"><strong>body must
           use the special symbol</strong></span> <code class="computeroutput"><span class="identifier">this_</span></code>
           (instead of <code class="computeroutput"><span class="keyword">this</span></code>) to access
- the bound object. <sup>[<a name="id870776" href="#ftn.id870776" class="footnote">9</a>]</sup>
+ the bound object. <sup>[<a name="id870899" href="#ftn.id870899" class="footnote">9</a>]</sup>
         </p>
 <p>
           Unfortunately, mistakenly using <code class="computeroutput"><span class="keyword">this</span></code>
           within the local function body instead of <code class="computeroutput"><span class="identifier">this_</span></code>
- will not necessarily generate a compile-time error. <sup>[<a name="id870870" href="#ftn.id870870" class="footnote">10</a>]</sup> Programmers are responsible to make sure that <code class="computeroutput"><span class="keyword">this</span></code> is never used within a local function
+ will not necessarily generate a compile-time error. <sup>[<a name="id870993" href="#ftn.id870993" class="footnote">10</a>]</sup> Programmers are responsible to make sure that <code class="computeroutput"><span class="keyword">this</span></code> is never used within a local function
           body which should only use the special symbol <code class="computeroutput"><span class="identifier">this_</span></code>.
         </p>
 </td></tr>
@@ -821,13 +832,14 @@
         Local blocks are defined using the following macros within a declarative
         context (see the Reference section):
       </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context.
-</span> <span class="special">...</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
+<span class="special">...</span>
+<span class="special">{</span> <span class="comment">// Some declarative context.
+</span> <span class="special">...</span>
     <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">BOOST_LOCAL_BLOCK</a></code><span class="special">(</span><span class="emphasis"><em>bindings</em></span><span class="special">)</span> <span class="special">{</span>
         <span class="emphasis"><em>body-code</em></span>
     <span class="special">}</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_BLOCK_END.html" title="Macro BOOST_LOCAL_BLOCK_END">BOOST_LOCAL_BLOCK_END</a></code>
-
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
@@ -855,7 +867,7 @@
           A <code class="computeroutput"><span class="keyword">return</span><span class="special">;</span></code>
           instruction from within a local block jumps to the end of the local block
           body and <span class="bold"><strong>it does not return the enclosing function</strong></span>.
- <sup>[<a name="id873248" href="#ftn.id873248" class="footnote">11</a>]</sup>
+ <sup>[<a name="id873437" href="#ftn.id873437" class="footnote">11</a>]</sup>
         </p></td></tr>
 </table></div>
 <p>
@@ -941,13 +953,14 @@
         Local exits are defined using the following macros within a declarative context
         (see the Reference section):
       </p>
-<pre class="programlisting"><span class="special">{</span> <span class="comment">// Some declarative context.
-</span> <span class="special">...</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
+<span class="special">...</span>
+<span class="special">{</span> <span class="comment">// Some declarative context.
+</span> <span class="special">...</span>
     <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_EXIT.html" title="Macro BOOST_LOCAL_EXIT">BOOST_LOCAL_EXIT</a></code><span class="special">(</span><span class="emphasis"><em>bindings</em></span><span class="special">)</span> <span class="special">{</span>
- <span class="emphasis"><em>exit-body</em></span>
+ <span class="emphasis"><em>body-code</em></span>
     <span class="special">}</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_EXIT_END.html" title="Macro BOOST_LOCAL_EXIT_END">BOOST_LOCAL_EXIT_END</a></code>
-
     <span class="special">...</span>
 <span class="special">}</span>
 </pre>
@@ -957,7 +970,7 @@
         If multiple local exits are declared within the same scope, their bodies
         will be executed in the reverse order in which they have been declared. The
         execution of the local exit code can be guaranteed only if the program does
- not terminate because of an uncaught exception. <sup>[<a name="id874394" href="#ftn.id874394" class="footnote">12</a>]</sup>
+ not terminate because of an uncaught exception. <sup>[<a name="id874641" href="#ftn.id874641" class="footnote">12</a>]</sup>
       </p>
 <p>
         Only bound variables specified by <code class="literal"><span class="emphasis"><em>bindings</em></span></code>
@@ -1061,10 +1074,10 @@
         Local exits are very similar to the <span class="emphasis"><em>scope exits</em></span> provided
         by Boost.ScopeExit
         with the addition that they also support constant binding and binding of
- the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id875646" href="#ftn.id875646" class="footnote">13</a>]</sup>
+ the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id875892" href="#ftn.id875892" class="footnote">13</a>]</sup>
       </p>
 <a name="boost_local.Tutorial.local_exits.d_s_scope_guards"></a><h6>
-<a name="id875873"></a>
+<a name="id876119"></a>
         <a class="link" href="Tutorial.html#boost_local.Tutorial.local_exits.d_s_scope_guards">D's Scope
         Guards</a>
       </h6>
@@ -1156,7 +1169,7 @@
         When local functions, local blocks, and local exits are programmed within
         templates, they need to be declared using the following special macros ending
         with the <code class="computeroutput"><span class="identifier">TPL</span></code> postfix (see
- the Reference section): <sup>[<a name="id877428" href="#ftn.id877428" class="footnote">14</a>]</sup>
+ the Reference section): <sup>[<a name="id877674" href="#ftn.id877674" class="footnote">14</a>]</sup>
       </p>
 <pre class="programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS_TPL">BOOST_LOCAL_FUNCTION_PARAMS_TPL</a></code><span class="special">(</span><span class="emphasis"><em>parameters</em></span><span class="special">)</span>
 <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_BLOCK_TPL.html" title="Macro BOOST_LOCAL_BLOCK_TPL">BOOST_LOCAL_BLOCK_TPL</a></code><span class="special">(</span><span class="emphasis"><em>bindings</em></span><span class="special">)</span>
@@ -1289,20 +1302,20 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id865988" href="#id865988" class="para">3</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id866036" href="#id866036" class="para">3</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> If the local function body
           were instead passed as a macro parameter, it would be expanded on a single
           line of code (because macros always expand as a single line of code). Therefore,
           eventual compiler error line numbers would all have the same value and
           would no longer be useful to pinpoint the error.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id866018" href="#id866018" class="para">4</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id866072" href="#id866072" class="para">4</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> The local function name must
           be passed to the macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
           ending the function definition so this macro can declare a local variable
           with the local function name to hold the local functor object.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id867944" href="#id867944" class="para">5</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id867998" href="#id867998" class="para">5</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> The assignment symbol <code class="computeroutput"><span class="special">=</span></code> cannot be used to specify default parameter
           values because default values are not part of the parameter type so they
           cannot be handled using template metaprogamming. Default parameter values
@@ -1312,7 +1325,7 @@
           it counts the number of default values to provide the correct set of call
           operators for the local functor object.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id869130" href="#id869130" class="para">6</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id869232" href="#id869232" class="para">6</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> By binding a variable in scope,
           the local function declaration is specifying that such a variable should
           be accessible within the local function body regardless of its type. Semantically,
@@ -1325,7 +1338,7 @@
           This is especially useful for maintenance so if a bound variable type is
           changed, the local function declaration does not have to change.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id869215" href="#id869215" class="para">7</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id869327" href="#id869327" class="para">7</a>] </sup>
           The token <code class="computeroutput"><span class="identifier">bind</span></code> is not a
           real keyword of the C++ language. This library parses <code class="computeroutput"><span class="identifier">bind</span></code>
           during macro expansion using preprocessor metaprogramming. Therefore,
@@ -1334,7 +1347,7 @@
           within the syntax defined by the macros of this library -- thus it is referred
           to as a "keyword" only within quotes.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id869470" href="#id869470" class="para">8</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id869592" href="#id869592" class="para">8</a>] </sup>
           An historical note: Constant binding of variables in scope was the main
           use case that originally motivated the authors in developing this library.
           The authors needed to locally create a chuck of code to assert some correctness
@@ -1349,7 +1362,7 @@
           generates an error because the bound variable is of <code class="computeroutput"><span class="keyword">const</span></code>
           type within the local function body.
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id870776" href="#id870776" class="para">9</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id870899" href="#id870899" class="para">9</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> This limitation comes from
             the fact that <code class="computeroutput"><span class="keyword">this</span></code> is a
             reserved C++ keyword so it cannot be used as the name of the internal
@@ -1363,7 +1376,7 @@
             behaviour of <code class="computeroutput"><span class="keyword">static_cast</span></code></a>
             (which might not work on all platforms at the cost of portability).
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id870870" href="#id870870" class="para">10</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id870993" href="#id870993" class="para">10</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> The local function body cannot
             be a static member function of the local functor object in order to support
             recursion (because the local function name is specified by the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
@@ -1376,7 +1389,7 @@
             is visible but it refers to the local functor object and not to the bound
             object.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id873248" href="#id873248" class="para">11</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id873437" href="#id873437" class="para">11</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> Programmers might expect
             <code class="computeroutput"><span class="keyword">return</span><span class="special">;</span></code>
             to exit the enclosing function instead of the local block (or local exit),
@@ -1394,7 +1407,7 @@
             <code class="computeroutput"><span class="identifier">BOOST_LOCAL_RETURN</span><span class="special">;</span></code>)
             to exit local blocks (and local exits).
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id874394" href="#id874394" class="para">12</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id874641" href="#id874641" class="para">12</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This library (as well as Boost.ScopeExit)
           uses the destructor of a local variable to automatically execute the local
           exit code upon exit of the enclosing scope. However, in C++ it is no possible
@@ -1403,7 +1416,7 @@
           different from the D programming language which executes the scope exit
           code even if the main program terminates because of an uncaught exception.)
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id875646" href="#id875646" class="para">13</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id875892" href="#id875892" class="para">13</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This library could be merged
           together with Boost.ScopeExit
           into a new library named Boost.Scope (from the meaning of the word "scope"
@@ -1430,7 +1443,7 @@
           name of "<a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html" target="_top">nested
           functions</a>".
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id877428" href="#id877428" class="para">14</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id877674" href="#id877674" class="para">14</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> Within templates, this library
           needs to use <code class="computeroutput"><span class="keyword">typename</span></code> to explicitly
           indicate that some expressions evaluate to a type. Because C++ does not

Modified: sandbox/local/libs/local/doc/html/index.html
==============================================================================
--- sandbox/local/libs/local/doc/html/index.html (original)
+++ sandbox/local/libs/local/doc/html/index.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -5,7 +5,7 @@
 <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="Boost.Local 0.1.1">
-<link rel="next" href="boost_local/Starting.html" title="Starting">
+<link rel="next" href="boost_local/Starting.html" title="Getting Started">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -37,9 +37,9 @@
 <p><b>Table of Contents</b></p>
 <dl>
 <dt><span class="section">Introduction</span></dt>
-<dt><span class="section">Starting</span></dt>
+<dt><span class="section">Getting Started</span></dt>
 <dt><span class="section">Tutorial</span></dt>
-<dt><span class="section">Advanced</span></dt>
+<dt><span class="section">Advanced Topics</span></dt>
 <dt><span class="section">Reference</span></dt>
 <dt><span class="section">Appendix: Examples</span></dt>
 <dt><span class="section">Appendix: Alternatives</span></dt>
@@ -419,7 +419,7 @@
 </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: March 10, 2011 at 14:09:29 GMT</small></p></td>
+<td align="left"><p><small>Last revised: March 10, 2011 at 21:42:14 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/local/libs/local/doc/html/reference.html
==============================================================================
--- sandbox/local/libs/local/doc/html/reference.html (original)
+++ sandbox/local/libs/local/doc/html/reference.html 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="index.html" title="Boost.Local 0.1.1">
 <link rel="up" href="index.html" title="Boost.Local 0.1.1">
-<link rel="prev" href="boost_local/Advanced.html" title="Advanced">
+<link rel="prev" href="boost_local/Advanced.html" title="Advanced Topics">
 <link rel="next" href="BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">

Modified: sandbox/local/libs/local/doc/qbk/advanced.qbk
==============================================================================
--- sandbox/local/libs/local/doc/qbk/advanced.qbk (original)
+++ sandbox/local/libs/local/doc/qbk/advanced.qbk 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -4,15 +4,15 @@
 [/ License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a ]
 [/ copy at http://www.boost.org/LICENSE_1_0.txt). ]
 
-[section:Advanced Advanced]
+[section:Advanced Advanced Topics]
 
 This section illustrates advanced usage of this library.
 At the end of this section there is also a list of knwon limitations of this library.
 
 [section Commas and Symbols in Macro Parameters]
 
-The C++ preprocessor does not allow commas "`,`" within macro parameters unless they are wrapped by the round parenthesis `()`.
-Therefore, using commas the local function parameters and bindings passed to this library macros ill generate (cryptic) preprocessor errors unless they are wrapped within extra round parenthesis `()` as explained here.
+The C++ preprocessor does not allow commas `,` within macro parameters unless they are wrapped by the round parenthesis `()`.
+Therefore, using commas within the local function parameters and bindings will generate (cryptic) preprocessor errors unless they are wrapped within extra round parenthesis `()` as explained here.
 
 [note
 *Macro parameters with commas* which are already wrapped by round parenthesis `()` are fine (function calls, etc).
@@ -23,7 +23,7 @@
 In addition, local function parameter types cannot start with non-alphanumeric symbols (alphanumeric symbols are `A-Z`, `a-z`, and `0-9`).
 [footnote
 *Rationale.*
-This limitation cames from the implementation of the library parsing macros that use preprocessor token concatenation to inspect the parameter type token to see if the token is a parameter or a bound variable.
+This limitation derives from the fact that `__BOOST_LOCAL_FUNCTION_PARAMS__` uses preprocessor token concatenation to inspect the parameter type token to see if the token is a parameter or a bound variable.
 The C++ preprocessor does not allow to concatenate non-alphanumeric tokens.
 ]
 The library will generate (cryptic) preprocessor errors if a parameter type starts with a non-alphanumeric symbol.
@@ -33,40 +33,40 @@
 [table
 [ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
 [ [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         const std::map<std::string, size_t>& m, // (1) Error.
         ::sign_t sign, // (2) Error.
         const size_t& factor, default
                 key_size<std::string, size_t>::value, // (3) Error.
         const std::string& separator, default cat(":", " "), // (4) OK.
- )
+ ) ...
 ``] [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         (const std::map<std::string, size_t>& m) // (1) Error.
         (::sign_t sign) // (2) Error.
         (const size_t& factor)(default
                 key_size<std::string, size_t>::value) // (3) Error.
         (const std::string& separator)(default cat(":", " ")) // (4) OK.
- )
+ ) ...
 ``] ]
 ]
 
-[*(1)] The parameter type `const std::map<std::string, size_t>&` contains a comma "`,`" after the first template parameter `std::string`.
+[*(1)] The parameter type `const std::map<std::string, size_t>&` contains a comma `,` after the first template parameter `std::string`.
 This comma is not wrapped by any round parenthesis `()` (the outer parenthesis `()` that make the sequencing macro syntax do not count) thus it will cause a preprocessor error.
 The macro `__BOOST_IDENTITY_TYPE__(`/parenthesized-type/`)` can be used to wrap a type within extra parenthesis `()` so to overcome this issue:
 
 [table
 [ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
 [ [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         __BOOST_IDENTITY_TYPE__((const std::map<std::string, size_t>&)) m, // OK.
         ...
- )
+ ) ...
 ``] [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         (__BOOST_IDENTITY_TYPE__((const std::map<std::string, size_t>&)) m) // OK.
         ...
- )
+ ) ...
 ``] ]
 ]
 
@@ -74,89 +74,93 @@
 Note that a total of two set of parenthesis `()` are added:
 
 # Parenthesis to invoke the `__BOOST_IDENTITY_TYPE__` macro.
-# Parenthesis to wrap the type expression (and therefore any commas "`,`" that it contains) passed as parameter to the `__BOOST_IDENTITY_TYPE__` macro.
+# Parenthesis to wrap the type expression (and therefore any commas `,` that it contains) passed as parameter to the `__BOOST_IDENTITY_TYPE__` macro.
 [footnote
 *Rationale.*
 Using variadic macros, this extra set of parenthesis could be eliminated requiring only the parenthesis to invoke the `__BOOST_IDENTITY_TYPE__` macro.
-This feature is currently not implemented and the double parenthesis are always needed when invoking this macro.
+However, this feature is currently not implemented and the double parenthesis are always needed when invoking this macro.
 ]
 
-[*(2)] The parameter type `::sign_t` start with the non-alphanumeric symbols "`::`" thus it cannot be used by the parenthesized syntax.
-The macros `__BOOST_IDENTITY_TYPE__` can also be used to overcome these issue:
+[*(2)] The parameter type `::sign_t` start with the non-alphanumeric symbols `::` thus it will generate preprocessor errors if used as a local function parameter type.
+The macros `__BOOST_IDENTITY_TYPE__` can also be used to overcome this issue:
 
 [table
 [ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
 [ [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
         __BOOST_IDENTITY_TYPE__((::sign_t)) sign, // OK.
         ...
- )
+ ) ...
 ``] [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
         (__BOOST_IDENTITY_TYPE__((::sign_t)) sign) // OK.
         ...
- )
+ ) ...
 ``] ]
 ]
 
-Often, there might be better ways to overcome this limitation that lead to code which is more readable than the one using these macros.
-For example, in this case the symbol "`::`" could be simply dropped to obtain the following and more readable code:
+Often, there might be better ways to overcome this limitation that lead to code which is more readable than the one using the `__BOOST_IDENTITY_TYPE__` macro.
+For example, in this case the symbols `::` could have been simply dropped to obtain the following valid and more readable code:
 
 [table
 [ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
 [ [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
- sign_t sign, // OK.
+ sign_t sign, // OK.
         ...
- )
+ ) ...
 ``] [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
         (sign_t sign) // OK.
         ...
- )
+ ) ...
 ``] ]
 ]
 
-[*(3)] The default parameter value `key_size<std::string, size_t>::value` contains a comma "`,`" after the first template parameter `std::string`.
+[*(3)] The default parameter value `key_size<std::string, size_t>::value` contains a comma `,` after the first template parameter `std::string`.
 Again, this comma is not wrapped by any parenthesis `()` so it will cause a preprocessor error.
-Because this is a value expression (and not a type expression), it can simply be wrapped within an extra set of round parenthesis `()`:
+Because this is a value expression (and not a type expression), it can be simply wrapped within an extra set of round parenthesis `()`:
 
 [table
 [ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
 [ [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
         const size_t& factor, default
                 (key_size<std::string, size_t>::value), // OK.
         ...
- )
+ ) ...
 ``] [``
- __BOOST_LOCAL_FUNCTION_PARAMS__(
+ ... __BOOST_LOCAL_FUNCTION_PARAMS__(
         ...
         (const size_t& factor)(default
                 (key_size<std::string, size_t>::value)) // OK.
         ...
- )
+ ) ...
 ``] ]
 ]
 
 
 [note
-Alternatively, the macro `__BOOST_IDENTITY_VALUE__(`/parenthesized-value/`)` could have been equivalently used.
-This macro expands to an expression that evaluates (at run-time) exactly to the specified value (but it adds overhead compared with simply using the extra parenthesis `()`).
-Note that, similarly to `__BOOST_IDENTITY_TYPE__`, the `__BOOST_IDENTITY_VALUE__` macro also requires two sets of extra parenthesis one set for invoking the macro and another set to wrap the value.
+Alternatively, the macro `__BOOST_IDENTITY_VALUE__(`/parenthesized-value/`)` could have been used.
+This macro expands to an expression that evaluates (at run-time) exactly to the specified value -- but it adds overhead compared with simply using the extra parenthesis `()`.
+Note that, similarly to `__BOOST_IDENTITY_TYPE__`, the `__BOOST_IDENTITY_VALUE__` macro also requires two sets of extra parenthesis one set for invoking the macro and another set to wrap the value expression passed as the macro parameter.
 ]
 
-[*(4)] The default parameter value `cat(':', ' ')` is instead fine because it contains a comma "`,`" which is already wrapped by the parenthesis `()` of the function call `cat(...)`.
+[*(4)] The default parameter value `cat(":", " ")` is instead fine because it contains a comma `,` which is already wrapped by the parenthesis `()` of the function call `cat(...)`.
+
+[important
+The `__BOOST_IDENTITY_TYPE__` macro must be prefixed by the `typename` keyword when used within templates.
+]
 
 Consider the following complete example:
 [footnote
-The authors recognize that the use of the /identity macros/ adds extra parenthesis to the already significant number of parenthesis required by the parenthesized syntax.
-However, macro parameters usually do not contain unwrapped commas "`,`" (unless template metaprogramming is being used).
+The authors recognize that the use of the /identity macros/ adds extra parenthesis to the already significant number of parenthesis required by the sequencing macro syntax.
+However, macro parameters usually do not contain unwrapped commas `,` (unless template metaprogramming is being used) so this is usually not a problem.
 ]
 
 [table
@@ -164,29 +168,49 @@
 [ [ [print_map_va_cpp] ] [ [print_map_cpp] ] ]
 ]
 
-The `__BOOST_IDENTITY_TYPE__` macro must be prefixed by the `typename` keyword when used within templates.
-
 [endsect]
 
 [section Deducing Bound Types]
 
+While the ISO C++ standard does not allow for member functions of local classes to have template parameters, this library allows to call template functions from within a local function, a local block, or a local exit passing bound variables without explicitly specifying their types.
+This essentially allows local functions, local blocks, and local exits to be [@http://en.wikipedia.org/wiki/Type_polymorphism polymorphic] in the type of the bound variables (like a template is polymorphic in the type of its template parameters).
+
+Furthermore, this library allow to access the type of the bound variables from within the local function, local block, or local exit using the following macro:
+
+ #include <boost/local/typeof.hpp>
+
+ ... // Within a local function, local block, or local exit.
+ __BOOST_LOCAL_TYPEOF__(``/bound-variable/``) ...
+ ...
+
+This macro expands to a type expression that evaluates (at compile-time) to the fully qualified type of the specified bound variable.
+This type expression is fully qualified in the sense that it will be constant if the variable is bound by constant and it will also be a reference is the variable is bound by reference (if needed, programmers can strip away the `const` and `&` qualifiers using `boost::remove_const` and `boost::remove_reference`, or similar template metafunctions).
+
+For example:
+
+[table
+[ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
+[ [ [typeof_va_cpp] ] [ [typeof_cpp] ] ]
+]
+
+Within templates, `__BOOST_LOCAL_TYPEOF__` does not require to be prefixed by the `typename` keyword but eventual type manipulations need the `typename` prefix as usual:
+
+[table
+[ [Variadic Macro Syntax (C99 and later compilers)] [Sequencing Macro Syntax (all C++ compilers)] ]
+[ [ [typeof_tpl_va_cpp] ] [ [typeof_tpl_cpp] ] ]
+]
+
 [endsect]
 
 [section Passing Local Functions]
 
-It is possible to obtain a reference to a local function so to assign it to a variable, to pass it as a function parameter, etc.
+It is possible to assign a local function to a functor (e.g., `boost::function`) in order to pass the local function to another function, etc.
+It is in general recommended to use the `boost::local::__function__` functor instead because its API also supports default parameters.
 
 [important
-Local functions are never copied by value.
-You can only obtain a reference to a local function therefore you need to make sure that the *local function survives the scope of its reference* otherwise the reference will be invalid and its use will generate a run-time error (as usual with C++ references).
-[footnote
-The suffix `ref` of `boost::local::__function__` is meant to help programmers remember that they are dealing with references to (and not copies of) local functions.
-]
+When assigning a local function to a functor programmers need to make sure that the *local function survives the scope of the functor* otherwise the functor will be invalid and its use will generate a run-time error (as usual with C++ functors).
 ]
 
-For this purpose, it is possible to assign a `boost::function` functor to a local function (see also __Boost_Function__).
-However, it is in general preferable to use the `boost::local::__function__` functor instead because its API also supports default parameters.
-
 The `boost::local::__function__` template takes two parameters (see the __Reference__ section):
 
     template< typename F, size_t defaults = 0 > class __function__;
@@ -200,9 +224,8 @@
     __function__< int(double, char) > // Returns `int`and takes two parameters: a `double` followed by a `char`.
 ``] ]
 [ [defaults] [
-The template parameter `defaults` specifies the number of defaults parameters counting from the last parameter: `0` if no parameter is optional, `1` if the last parameter is optional, `2` if the last two parameters are optional, etc.
-This template parameter must be between `0` and the total number of parameters as specified by `F`.
-This template parameter is optional and it is `0` by default.
+The template parameter `defaults` specifies the number of defaults parameters (counting from the last parameter as usual): `0` if no parameter is optional, `1` if the last parameter is optional, `2` if the last two parameters are optional, etc.
+The `defaults` template parameter must be between `0` and the total number of parameters as specified by `F`, it is optional and it is `0` by default.
 For example:``
     __function__< int(double, char) > // No default: All parameters must be specified.
     __function__< int(double, char), 1 > // 1 default: The last `char` parameter is optional.
@@ -247,8 +270,6 @@
 Compilers might not be able to optimize away the local function overhead even when `inline`, `auto`, and `register` are used.
 ]
 
-For example:
-
 [add_optimizers_cpp]
 
 [endsect]

Modified: sandbox/local/libs/local/doc/qbk/alternatives.qbk
==============================================================================
--- sandbox/local/libs/local/doc/qbk/alternatives.qbk (original)
+++ sandbox/local/libs/local/doc/qbk/alternatives.qbk 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -12,6 +12,11 @@
 
 The following table compares local function features.
 
+@todo From Mathias: Minus of Local compared to Lambdas:
+ - creating a local can only be done at statement scope.
+ - locals may not automatically capture all context
+ - size of a local function cannot be optimized to be two words.
+
 [table
 [
     [ Local Function Feature ]

Modified: sandbox/local/libs/local/doc/qbk/local.qbk
==============================================================================
--- sandbox/local/libs/local/doc/qbk/local.qbk (original)
+++ sandbox/local/libs/local/doc/qbk/local.qbk 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -96,6 +96,10 @@
 [import ../../example/doit_va.cpp]
 [import ../../example/transform.cpp]
 [import ../../example/transform_va.cpp]
+[import ../../example/typeof.cpp]
+[import ../../example/typeof_va.cpp]
+[import ../../example/typeof_tpl.cpp]
+[import ../../example/typeof_tpl_va.cpp]
 
 [import ../../example/add_num_sum.cpp]
 [import ../../example/factorial.cpp]

Modified: sandbox/local/libs/local/doc/qbk/starting.qbk
==============================================================================
--- sandbox/local/libs/local/doc/qbk/starting.qbk (original)
+++ sandbox/local/libs/local/doc/qbk/starting.qbk 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -4,7 +4,7 @@
 [/ License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a ]
 [/ copy at http://www.boost.org/LICENSE_1_0.txt). ]
 
-[section:Starting Starting]
+[section:Starting Getting Started]
 
 This section explains how to setup your system to use this library.
 

Modified: sandbox/local/libs/local/doc/qbk/tutorial.qbk
==============================================================================
--- sandbox/local/libs/local/doc/qbk/tutorial.qbk (original)
+++ sandbox/local/libs/local/doc/qbk/tutorial.qbk 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -13,13 +13,14 @@
 
 Local functions are defined using the following macros (see the __Reference__ section) from within a declarative context (this is a limitation with respect to __CPP0x_lambda__ functions which can instead be declared within expressions):
 
+ #include <boost/local/function.hpp>
+
+ ...
     { // Some declarative context.
         ...
-
         ``/result-type/`` __BOOST_LOCAL_FUNCTION_PARAMS__(``/parameters/``) {
             ``/body-code/``
         } __BOOST_LOCAL_FUNCTION_NAME__(``/name/``)
-
         ...
     }
 
@@ -131,7 +132,10 @@
 
 If this variadic macro syntax seems strange, programmers could define a `WITH_DEFAULT` macro similar to the following if they think it improves readability:
 
-[add_x_y_default_with_va_cpp]
+[table
+[ [Variadic Macro Syntax (C99 and later compilers)] ]
+[ [ [add_x_y_default_with_va_cpp] ] ]
+]
 
 [endsect]
 
@@ -245,13 +249,14 @@
 
 Local blocks are defined using the following macros within a declarative context (see the __Reference__ section):
 
+ #include <boost/local/block.hpp>
+
+ ...
     { // Some declarative context.
         ...
-
         __BOOST_LOCAL_BLOCK__(``/bindings/``) {
             ``/body-code/``
         } __BOOST_LOCAL_BLOCK_END__
-
         ...
     }
 
@@ -283,13 +288,14 @@
 
 Local exits are defined using the following macros within a declarative context (see the __Reference__ section):
 
+ #include <boost/local/exit.hpp>
+
+ ...
     { // Some declarative context.
         ...
-
         __BOOST_LOCAL_EXIT__(``/bindings/``) {
- ``/exit-body/``
+ ``/body-code/``
         } __BOOST_LOCAL_EXIT_END__
-
         ...
     }
 

Modified: sandbox/local/libs/local/example/typeof_tpl.cpp
==============================================================================
--- sandbox/local/libs/local/example/typeof_tpl.cpp (original)
+++ sandbox/local/libs/local/example/typeof_tpl.cpp 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -4,7 +4,7 @@
 // License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
 // copy at http://www.boost.org/LICENSE_1_0.txt).
 
-//[typeof_template_cpp
+//[typeof_tpl_cpp
 #include <boost/local/function.hpp>
 #include <boost/local/block.hpp>
 #include <boost/local/exit.hpp>

Added: sandbox/local/libs/local/example/typeof_tpl_va.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/typeof_tpl_va.cpp 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,55 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+//[typeof_tpl_va_cpp
+#include <boost/local/function.hpp>
+#include <boost/local/block.hpp>
+#include <boost/local/exit.hpp>
+#include <boost/local/typeof.hpp> // Typeof header.
+#include <boost/type_traits.hpp>
+#include <algorithm>
+#include <cassert>
+
+template<typename T>
+T total(const T& x, const T& y, const T& z) {
+ T sum = T();
+ int factor = 10;
+
+ T BOOST_LOCAL_FUNCTION_PARAMS_TPL(T num, const bind factor,
+ bind& sum) {
+ BOOST_LOCAL_TYPEOF(factor) f = factor;
+ return sum += f * num;
+ } BOOST_LOCAL_FUNCTION_NAME(add)
+ add(x);
+
+ size_t size = 2;
+ T* nums = new T[size];
+ BOOST_LOCAL_EXIT_TPL(const bind& size, bind nums) {
+ BOOST_LOCAL_TYPEOF(size) s = size;
+ if (s && nums) delete[] nums;
+ } BOOST_LOCAL_EXIT_END
+
+ nums[0] = y; nums[1] = z;
+ std::for_each(nums, nums + size, add);
+
+ BOOST_LOCAL_BLOCK_TPL(const bind &sum, const bind& factor,
+ const bind& x, const bind& y, const bind& z) {
+ // Typeof qualified with eventual bind's `const` and `&`.
+ typename boost::remove_const<typename boost::remove_reference<
+ BOOST_LOCAL_TYPEOF(sum)>::type>::type s;
+ s = sum;
+ assert(s == factor * (x + y + z));
+ } BOOST_LOCAL_BLOCK_END
+
+ return sum;
+}
+
+int main() {
+ total(100.0, 90.5, 7.0);
+ return 0;
+}
+//]
+

Added: sandbox/local/libs/local/example/typeof_va.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/typeof_va.cpp 2011-03-11 09:33:21 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,54 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+//[typeof_va_cpp
+#include <boost/local/function.hpp>
+#include <boost/local/block.hpp>
+#include <boost/local/exit.hpp>
+#include <boost/local/typeof.hpp> // Typeof header.
+#include <boost/type_traits.hpp>
+#include <algorithm>
+#include <cassert>
+
+double total(const double& x, const double& y, const double& z) {
+ double sum = double();
+ int factor = 10;
+
+ double BOOST_LOCAL_FUNCTION_PARAMS(double num, const bind factor,
+ bind& sum) {
+ BOOST_LOCAL_TYPEOF(factor) f = factor;
+ return sum += f * num;
+ } BOOST_LOCAL_FUNCTION_NAME(add)
+ add(x);
+
+ size_t size = 2;
+ double* nums = new double[size];
+ BOOST_LOCAL_EXIT(const bind& size, bind nums) {
+ BOOST_LOCAL_TYPEOF(size) s = size;
+ if (s && nums) delete[] nums;
+ } BOOST_LOCAL_EXIT_END
+
+ nums[0] = y; nums[1] = z;
+ std::for_each(nums, nums + size, add);
+
+ BOOST_LOCAL_BLOCK(const bind &sum, const bind& factor,
+ const bind& x, const bind& y, const bind& z) {
+ // Typeof qualified with eventual bind's `const` and `&`.
+ boost::remove_const<boost::remove_reference<
+ BOOST_LOCAL_TYPEOF(sum)>::type>::type s;
+ s = sum;
+ assert(s == factor * (x + y + z));
+ } BOOST_LOCAL_BLOCK_END
+
+ return sum;
+}
+
+int main() {
+ total(100.0, 90.5, 7.0);
+ return 0;
+}
+//]
+


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