Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68764 - in sandbox/local/libs/local: doc doc/html doc/html/boost/local doc/html/boost_local doc/qbk simpler_syntax
From: lorcaminiti_at_[hidden]
Date: 2011-02-10 14:54:10


Author: lcaminiti
Date: 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
New Revision: 68764
URL: http://svn.boost.org/trac/boost/changeset/68764

Log:
Added prototyping code for simplifying local function syntax from parenthesized syntax.
Added:
   sandbox/local/libs/local/doc/html/boost_local/Rationale.html (contents, props changed)
   sandbox/local/libs/local/doc/qbk/rationale.qbk (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/
   sandbox/local/libs/local/simpler_syntax/00.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/TODO.txt (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/add_nim_factor_sum_nomacros.01.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.02.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.03.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.00.txt (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/params.00.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/va00.cpp (contents, props changed)
   sandbox/local/libs/local/simpler_syntax/va01.cpp (contents, props changed)
Text files modified:
   sandbox/local/libs/local/doc/html/BOOST_IDENTITY_TYPE.html | 2
   sandbox/local/libs/local/doc/html/BOOST_IDENTITY_VALUE.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_END.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_TPL.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_THIS_PARAM_NAME.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_END.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_TPL.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END_RENAME.html | 2
   sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_TPL.html | 2
   sandbox/local/libs/local/doc/html/boost/local/function_ref.html | 2
   sandbox/local/libs/local/doc/html/boost_local/Advanced.html | 34 +++++++++++-----------
   sandbox/local/libs/local/doc/html/boost_local/Examples.html | 6 ++--
   sandbox/local/libs/local/doc/html/boost_local/Grammar.html | 6 ++--
   sandbox/local/libs/local/doc/html/boost_local/Releases.html | 6 ++--
   sandbox/local/libs/local/doc/html/boost_local/Starting.html | 4 +-
   sandbox/local/libs/local/doc/html/boost_local/Tutorial.html | 58 ++++++++++++++++++++--------------------
   sandbox/local/libs/local/doc/html/index.html | 9 +++--
   sandbox/local/libs/local/doc/html/standalone_HTML.manifest | 1
   sandbox/local/libs/local/doc/jamfile.jam | 1
   sandbox/local/libs/local/doc/qbk/local.qbk | 7 ++--
   25 files changed, 83 insertions(+), 79 deletions(-)

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_IDENTITY_TYPE(parenthesized_type)</pre></div>
 <div class="refsect1">
-<a name="id891480"></a><h2>Description</h2>
+<a name="id891489"></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>
 <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>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_IDENTITY_VALUE(parenthesized_value)</pre></div>
 <div class="refsect1">
-<a name="id891621"></a><h2>Description</h2>
+<a name="id891630"></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>
 <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>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_BLOCK(parenthesized_binding)</pre></div>
 <div class="refsect1">
-<a name="id887875"></a><h2>Description</h2>
+<a name="id887883"></a><h2>Description</h2>
 <p>This macro must be used within a declarative context, it must be followed by the local block body code <code class="computeroutput">{ ... }</code> and then by the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_BLOCK_END.html" title="Macro BOOST_LOCAL_BLOCK_END">BOOST_LOCAL_BLOCK_END</a></code> macro (see the Tutorial section): </p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some declarative context.</span>
       <span class="special">...</span>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_BLOCK_END</pre></div>
 <div class="refsect1">
-<a name="id888269"></a><h2>Description</h2>
+<a name="id888276"></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"><a class="link" href="BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">BOOST_LOCAL_BLOCK</a></code> documentation.</p>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">BOOST_LOCAL_BLOCK</a></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_BLOCK_TPL.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_TPL.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_BLOCK_TPL.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_BLOCK_TPL(parenthesized_binding)</pre></div>
 <div class="refsect1">
-<a name="id888195"></a><h2>Description</h2>
+<a name="id888202"></a><h2>Description</h2>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">BOOST_LOCAL_BLOCK</a></code>, <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. </p>
 </div>
 </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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</pre></div>
 <div class="refsect1">
-<a name="id888412"></a><h2>Description</h2>
+<a name="id888420"></a><h2>Description</h2>
 <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>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_CONFIG_THIS_PARAM_NAME</pre></div>
 <div class="refsect1">
-<a name="id888511"></a><h2>Description</h2>
+<a name="id888519"></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>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_EXIT(parenthesized_binding)</pre></div>
 <div class="refsect1">
-<a name="id888657"></a><h2>Description</h2>
+<a name="id888664"></a><h2>Description</h2>
 <p>This macro must be used within a declarative context, it must be followed by the local exit body code <code class="computeroutput">{ ... }</code> and then by the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_EXIT_END.html" title="Macro BOOST_LOCAL_EXIT_END">BOOST_LOCAL_EXIT_END</a></code> macro (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section): </p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some declarative context.</span>
       <span class="special">...</span>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_EXIT_END</pre></div>
 <div class="refsect1">
-<a name="id889074"></a><h2>Description</h2>
+<a name="id889081"></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"><a class="link" href="BOOST_LOCAL_EXIT.html" title="Macro BOOST_LOCAL_EXIT">BOOST_LOCAL_EXIT</a></code> documentation.</p>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_EXIT.html" title="Macro BOOST_LOCAL_EXIT">BOOST_LOCAL_EXIT</a></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_EXIT_TPL.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_TPL.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_EXIT_TPL.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_EXIT_TPL(parenthesized_binding)</pre></div>
 <div class="refsect1">
-<a name="id889000"></a><h2>Description</h2>
+<a name="id889007"></a><h2>Description</h2>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_EXIT.html" title="Macro BOOST_LOCAL_EXIT">BOOST_LOCAL_EXIT</a></code>, <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. </p>
 </div>
 </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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION(parenthesized_signature)</pre></div>
 <div class="refsect1">
-<a name="id889233"></a><h2>Description</h2>
+<a name="id889241"></a><h2>Description</h2>
 <p>This macro must be used within a declarative context, it must be followed by the local function body code <code class="computeroutput">{ ... }</code> and then by either the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_END.html" title="Macro BOOST_LOCAL_FUNCTION_END">BOOST_LOCAL_FUNCTION_END</a></code> or the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_END_RENAME.html" title="Macro BOOST_LOCAL_FUNCTION_END_RENAME">BOOST_LOCAL_FUNCTION_END_RENAME</a></code> macro (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> and <a class="link" href="boost_local/Advanced.html" title="Advanced">Advanced</a> sections): </p>
 <pre class="programlisting"> <span class="special">{</span> <span class="comment">// Some declarative context.</span>
       <span class="special">...</span>

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_END(local_function_name)</pre></div>
 <div class="refsect1">
-<a name="id889720"></a><h2>Description</h2>
+<a name="id889728"></a><h2>Description</h2>
 <p>This macro must follow the local function body code <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> documentation.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END_RENAME.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END_RENAME.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_END_RENAME.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_END_RENAME(new_local_function_name)</pre></div>
 <div class="refsect1">
-<a name="id889889"></a><h2>Description</h2>
+<a name="id889897"></a><h2>Description</h2>
 <p>This macro must be used instead of the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_END.html" title="Macro BOOST_LOCAL_FUNCTION_END">BOOST_LOCAL_FUNCTION_END</a></code> macro and it must follow the local function body code <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code> documentation.</p>
 <p><span class="bold"><strong>Parameters:</strong></span> </p>
 <div class="informaltable"><table class="table">

Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_TPL.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_TPL.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_TPL.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -33,7 +33,7 @@
 
 </span>BOOST_LOCAL_FUNCTION_TPL(parenthesized_signature)</pre></div>
 <div class="refsect1">
-<a name="id889645"></a><h2>Description</h2>
+<a name="id889653"></a><h2>Description</h2>
 <p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>, <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section. </p>
 </div>
 </div>

Modified: sandbox/local/libs/local/doc/html/boost/local/function_ref.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost/local/function_ref.html (original)
+++ sandbox/local/libs/local/doc/html/boost/local/function_ref.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -35,7 +35,7 @@
 <span class="keyword">struct</span> <a class="link" href="function_ref.html" title="Struct template function_ref">function_ref</a> <span class="special">{</span>
 <span class="special">}</span><span class="special">;</span></pre></div>
 <div class="refsect1">
-<a name="id890337"></a><h2>Description</h2>
+<a name="id890345"></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>
 <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>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -194,7 +194,7 @@
 </span> <span class="special">)</span>
 </pre>
 <p>
- Consider the following complete example: <sup>[<a name="id875940" href="#ftn.id875940" class="footnote">15</a>]</sup>
+ Consider the following complete example: <sup>[<a name="id875947" href="#ftn.id875947" class="footnote">15</a>]</sup>
       </p>
 <p>
         
@@ -426,7 +426,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="id880460" href="#ftn.id880460" class="footnote">16</a>]</sup>
+ error (as usual with C++ references). <sup>[<a name="id880468" href="#ftn.id880468" class="footnote">16</a>]</sup>
         </p></td></tr>
 </table></div>
 <p>
@@ -548,7 +548,7 @@
         Where the <span class="emphasis"><em>new-local-function-name</em></span> no longer has to match
         the local function name as originally specified in the parenthesized signature
         passed to <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code>.
- For example: <sup>[<a name="id883162" href="#ftn.id883162" class="footnote">17</a>]</sup>
+ For example: <sup>[<a name="id883170" href="#ftn.id883170" class="footnote">17</a>]</sup>
       </p>
 <pre class="programlisting"><span class="special">{</span>
     <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION.html" title="Macro BOOST_LOCAL_FUNCTION">BOOST_LOCAL_FUNCTION</a></code><span class="special">(</span>
@@ -605,7 +605,7 @@
 <p>
       </p>
 <a name="boost_local.Advanced.renaming_local_functions.motivation"></a><h6>
-<a name="id884109"></a>
+<a name="id884117"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.renaming_local_functions.motivation">Motivation</a>
       </h6>
 <p>
@@ -672,14 +672,14 @@
         to usual features of C++ functions.
       </p>
 <a name="boost_local.Advanced.limitations__overloading__nesting__operators__etc.overloading"></a><h6>
-<a name="id885100"></a>
+<a name="id885108"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading__nesting__operators__etc.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="id885120" href="#ftn.id885120" class="footnote">18</a>]</sup>
+ parameters). <sup>[<a name="id885128" href="#ftn.id885128" class="footnote">18</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -702,12 +702,12 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading__nesting__operators__etc.nesting"></a><h6>
-<a name="id885584"></a>
+<a name="id885592"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading__nesting__operators__etc.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="id885606" href="#ftn.id885606" class="footnote">19</a>]</sup>
+ within each other. Nesting will generate a compile-time error. <sup>[<a name="id885614" href="#ftn.id885614" class="footnote">19</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -730,12 +730,12 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading__nesting__operators__etc.operators"></a><h6>
-<a name="id886028"></a>
+<a name="id886036"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading__nesting__operators__etc.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="id886065" href="#ftn.id886065" class="footnote">20</a>]</sup>
+ will generate a compile-time error. <sup>[<a name="id886073" href="#ftn.id886073" class="footnote">20</a>]</sup>
       </p>
 <p>
         For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -757,7 +757,7 @@
 <span class="special">}</span>
 </pre>
 <a name="boost_local.Advanced.limitations__overloading__nesting__operators__etc.etc"></a><h6>
-<a name="id886471"></a>
+<a name="id886479"></a>
         <a class="link" href="Advanced.html#boost_local.Advanced.limitations__overloading__nesting__operators__etc.etc">Etc</a>
       </h6>
 <p>
@@ -1062,39 +1062,39 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id875940" href="#id875940" class="para">15</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id875947" href="#id875947" class="para">15</a>] </sup>
           We 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, parenthesized signatures usually
           do not contain unwrapped commas "<code class="computeroutput"><span class="special">,</span></code>"
           (unless template metaprogramming is being used).
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id880460" href="#id880460" class="para">16</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id880468" href="#id880468" class="para">16</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_ref.html" title="Struct template function_ref">function_ref</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.id883162" href="#id883162" class="para">17</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id883170" href="#id883170" class="para">17</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> Local functions are often named
           <code class="computeroutput"><span class="identifier">l</span></code> in the casual examples
           of this documentation because the name of the author starts with the letter
           "<code class="computeroutput"><span class="identifier">l</span></code>". <span class="inlinemediaobject"><img src="../../images/smiley.png" alt="smiley"></span>
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id885120" href="#id885120" class="para">18</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id885128" href="#id885128" class="para">18</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.id885606" href="#id885606" class="para">19</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id885614" href="#id885614" class="para">19</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.id886065" href="#id886065" class="para">20</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id886073" href="#id886073" class="para">20</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/Examples.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Examples.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Examples.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -7,7 +7,7 @@
 <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="Alternatives.html" title="Appendix: Alternatives">
-<link rel="next" href="Releases.html" title="Releases">
+<link rel="next" href="Rationale.html" title="Appendix: Rationale">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Releases.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Rationale.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -233,7 +233,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Releases.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Alternatives.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Rationale.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/local/libs/local/doc/html/boost_local/Grammar.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Grammar.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Grammar.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -132,7 +132,7 @@
         <span class="special">(</span><span class="keyword">default</span><span class="special">)(</span><span class="bold"><strong>parameter-default</strong></span><span class="special">)</span> <span class="comment">// Default value for this optional parameter.
 </span></pre>
 <p>
- Binding variables in scope: <sup>[<a name="id892428" href="#ftn.id892428" class="footnote">21</a>]</sup> <sup>[<a name="id892732" href="#ftn.id892732" class="footnote">22</a>]</sup>
+ Binding variables in scope: <sup>[<a name="id892436" href="#ftn.id892436" class="footnote">21</a>]</sup> <sup>[<a name="id892741" href="#ftn.id892741" class="footnote">22</a>]</sup>
     </p>
 <pre class="programlisting"><span class="emphasis"><em>bindings:</em></span>
           <span class="emphasis"><em>const-bindings</em></span> <span class="comment">// Only constant binding.
@@ -151,7 +151,7 @@
 </span></pre>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id892428" href="#id892428" class="para">21</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id892436" href="#id892436" class="para">21</a>] </sup>
         <span class="bold"><strong>Rationale.</strong></span> The alternative syntax <code class="computeroutput"><span class="special">(</span><span class="identifier">bind</span><span class="special">)((</span><span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)...)</span></code>
         would have been preferred because <code class="computeroutput"><span class="keyword">const</span></code>
         appears before the reference as usual in C++ and because a single <code class="computeroutput"><span class="identifier">bind</span></code> sequence is used for both plain and
@@ -172,7 +172,7 @@
         symbol <code class="computeroutput"><span class="special">&amp;</span></code> never appears in
         the back).
       </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id892732" href="#id892732" class="para">22</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id892741" href="#id892741" class="para">22</a>] </sup>
         <span class="bold"><strong>Rationale.</strong></span> Binding is used within the function
         parameter list because this syntax seemed natural given that the bound variables
         are used by the function body as if they were function parameters (only their

Added: sandbox/local/libs/local/doc/html/boost_local/Rationale.html
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/doc/html/boost_local/Rationale.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,1253 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Appendix: Rationale</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">
+<link rel="up" href="../index.html" title="Boost.Local 0.1.1">
+<link rel="prev" href="Examples.html" title="Appendix: Examples">
+<link rel="next" href="Releases.html" title="Releases">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Releases.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_local.Rationale"></a><a class="link" href="Rationale.html" title="Appendix: Rationale">Appendix: Rationale</a>
+</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale">Parenthesized
+ Syntax Rationale</a></span></dt></dl></div>
+<p>
+ This section discusses rationale behind library design decisions in addition
+ to the rationale already provided throughout the rationale footnotes in the
+ rest of this documentation.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale" title="Parenthesized Syntax Rationale">Parenthesized
+ Syntax Rationale</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.c99_preprocessor">C99
+ Preprocessor</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.parameter_type_and_name_separation">Parameter
+ Type and Name Separation</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.empty_function_parameters">Empty
+ Function Parameters</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values">Default
+ Parameter Values</a></span></dt>
+</dl></div>
+<p>
+ This section discusses the rationale behind parenthesized syntax design decisions.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.c99_preprocessor"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.c99_preprocessor" title="C99 Preprocessor">C99
+ Preprocessor</a>
+</h4></div></div></div>
+<p>
+ The C99 preprocessor (and therefore the C++0x preprocessor) allows for
+ additional features like specifying empty macro parameters and variadic
+ macro parameters which are not supported by the ISO C++ standard preprocessor.
+ The additional features of the C99 preprocessor can be used to simplify
+ the parenthesized syntax mainly by removing extra parenthesis and making
+ it look more like normal C++ syntax.
+ </p>
+<p>
+ Most (and maybe all) modern compilers support the C99 preprocessor at this
+ time and all new C++0x compilers will support the C99 preprocessor in the
+ future. Therefore, the library macros have been programmed to automatically
+ detect the presence of the C99 preprocessor and accept the simplified parenthesized
+ syntax in these cases. The same macro will only accept the parenthesized
+ syntax on non C99 preprocessor but will accept both the parenthesized syntax
+ and the simplified parenthesized syntax on C99 preprocessors. This way,
+ programmers that can afford to write C99 specific code can benefit from
+ the simplifications of the parenthesized syntax.
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Function Feature
+ </p>
+ </th>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ Simplified Parenthesized Syntax (C99 only)
+ </p>
+ </th>
+<th>
+ <p>
+ Parenthesized Syntax (both C++ and C99)
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Empty Parameter List</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Or:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Using empty macro parameter:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)()</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// No extra parenthesis at all!
+</span><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Using <code class="computeroutput"><span class="keyword">void</span></code> parameter
+ list:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Parameter Types and Names</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Local functions do not need to access the parameter names separately
+ from their types so they are merged into a single token (even
+ if that reduces the generality of the syntax).
+ </p>
+ </td>
+<td>
+ <p>
+ Merging parameter type with its name and using variable length
+ tuples:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="comment">// Parameter list syntax same as normal.
+</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// No extra parenthesis at all!
+</span><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Merging parameter type with its name and using sequences:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</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">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Parameter Defaults</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">,</span>
+ <span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Parameter defaults need to be separated from their types and
+ names because they cannot be part of function type expressions.
+ The symbol <code class="computeroutput"><span class="special">=</span></code> cannot
+ be used because it is not alphanumeric so <code class="computeroutput"><span class="keyword">default</span></code>
+ is used instead.
+ </p>
+ </td>
+<td>
+ <p>
+ Using <code class="computeroutput"><span class="keyword">default</span></code> instead
+ of <code class="computeroutput"><span class="special">=</span></code> and variable
+ length tuples:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">,</span>
+ <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// No extra parenthesis needed.
+</span><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">,</span>
+ <span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Using <code class="computeroutput"><span class="keyword">default</span></code> instead
+ of <code class="computeroutput"><span class="special">=</span></code> and sequences:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</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">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Variable Binding</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+ Not supported by C++ (supported by C++0x via lambda functions).
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">int</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">b</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">c</span> <span class="special">=</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">d</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">/* bind a, b, c, d somehow... */</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Using <code class="computeroutput"><span class="identifier">bind</span></code> and
+ <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span></code>
+ instead of the parameter type and variable length typles:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">)</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// No extra parenthesis needed.
+</span><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">)</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+<td>
+ <p>
+ Using <code class="computeroutput"><span class="identifier">bind</span></code> and
+ <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span></code>
+ instead of the parameter type:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">)</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ But also when no recursion and Boost.Typeof for result type:
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="comment">// No extra parenthesis needed.
+</span><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">b</span><span class="special">,</span>
+ <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&amp;</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">)</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Feature
+ </p>
+ </th>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99 Split Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99 Parenthesized Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Split Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Parenthesized Syntax
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ Use variadics macro parameters (limitation -- C99 preprocessor
+ only).
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ Use empty macro parameter (limitation -- C99 preprocessor only).
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ Support recursive local function calls.
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ Always require Boost.Type of for result type (limitation).
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ Support <code class="computeroutput"><span class="keyword">inline</span></code> local
+ functions.
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+<td>
+ <p>
+ No.
+ </p>
+ </td>
+<td>
+ <p>
+ Yes.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Empty parameter list.</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Or:
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</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="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">()</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</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="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)()</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</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="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</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="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <span class="emphasis"><em>Parameter types and names.</em></span>
+ </p>
+ </td>
+<td>
+ <p>
+
+</p>
+<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</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="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span>
+ <span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</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="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</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="keyword">void</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">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</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="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+</pre>
+<p>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.parameter_type_and_name_separation"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.parameter_type_and_name_separation" title="Parameter Type and Name Separation">Parameter
+ Type and Name Separation</a>
+</h4></div></div></div>
+<p>
+ C++ allows to specify parameter names within function types:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span>
+</pre>
+<p>
+ Therefore, the parenthesized syntax for local functions does not have to
+ separate the function parameter type and name tokens:
+ </p>
+<div class="table">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.parameter_type_and_name_separation.parameter_types_and_names"></a><p class="title"><b>Table&#160;1.&#160;Parameter Types and Names</b></p>
+<div class="table-contents"><table class="table" summary="Parameter Types and Names">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Parenthesized Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99-Only Parenthesized Syntax
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">,</span>
+ <span class="keyword">double</span><span class="special">&amp;</span><span class="identifier">y</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">)</span>
+ <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">)</span>
+ <span class="comment">// Is this better than its general version
+ below selected by the authors? Local functions don't need the
+ generality...</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">)</span> <span class="comment">// Authors'
+ choice.</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ Note that a more general form of the parenthesized syntax would have been
+ instead:
+ </p>
+<div class="table">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.parameter_type_and_name_separation.separated_parameter_types_and_names"></a><p class="title"><b>Table&#160;2.&#160;Separated Parameter Types and Names</b></p>
+<div class="table-contents"><table class="table" summary="Separated Parameter Types and Names">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Parenthesized Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99-Only Parenthesized Syntax
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">,</span>
+ <span class="keyword">double</span><span class="special">&amp;</span>
+ <span class="identifier">y</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;)(</span><span class="identifier">y</span><span class="special">)</span>
+ <span class="special">)</span> <span class="comment">// Authors'
+ choice.</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span><span class="special">,</span>
+ <span class="identifier">x</span><span class="special">,</span>
+ <span class="keyword">double</span><span class="special">&amp;,</span>
+ <span class="identifier">y</span><span class="special">)</span></code>
+ <span class="emphasis"><em>-or-</em></span>
+ </p>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">,</span>
+ <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;,</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">)</span></code>
+ <span class="emphasis"><em>-or-</em></span>
+ </p>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">,</span>
+ <span class="special">(</span><span class="keyword">double</span><span class="special">&amp;)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">)</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ This more general form makes available the parameter types and names as
+ separate tokens for preprocessor metaprogramming. In fact, there is no
+ way for the preprocessor to split <code class="computeroutput"><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span></code> into the parameter type <code class="computeroutput"><span class="keyword">int</span></code> and name <code class="computeroutput"><span class="identifier">x</span></code>
+ while it can split <code class="computeroutput"><span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span></code>.
+ The parameter types can be split at compile-time (for example to force
+ some parameters to be constant, references, etc):
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">arg_type</span><span class="special">&lt;</span><span class="keyword">void</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">),</span> <span class="number">0</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">arg_type0</span><span class="special">;</span> <span class="comment">// int
+</span><span class="keyword">typedef</span> <span class="identifier">arg_type</span><span class="special">&lt;</span><span class="keyword">void</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&amp;</span> <span class="identifier">y</span><span class="special">),</span> <span class="number">1</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">arg_type1</span><span class="special">;</span> <span class="comment">// double&amp;
+</span></pre>
+<p>
+ But the parameter name <code class="computeroutput"><span class="identifier">x</span></code>
+ remains inaccessible as a token separately from its type. However, local
+ function do not need to access parameter types separately from their types
+ so this lack of generality is not an issue for local function and the less
+ general syntax (e.g., <code class="computeroutput"><span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">)</span></code>)
+ is preferred over the more general one (e.g., <code class="computeroutput"><span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span></code>) because it is simpler as it uses a smaller
+ number of parenthesis and resembles more closely the normal C++ syntax
+ for function parameters.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/src/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ <span class="bold"><strong>Overloaded functions.</strong></span> An example where
+ parameter names need to be accessed separately from their types is to
+ support overloading. For example, if the macro need to expand to support
+ code for an overloaded function, they might need to generate unique identifiers
+ for symbols within the support code. Assume also <code class="computeroutput"><span class="identifier">__LINE__</span></code>
+ cannot be used in this context because the unique identifiers need to
+ be referred by another macro expanding on a different line (so the unique
+ identifier need to be generated upon the function syntactic elements
+ -- function name, parameter names, etc). Such identifiers cannot simply
+ use the function name because the same function name is used multiple
+ times when the function is overloaded and therefore the identifiers will
+ not be unique. The parameter names can be concatenated by the preprocessor
+ together with the function name to generate such unique identifiers (with
+ the limitation that overloaded function need to used different parameter
+ names and not just different parameter types).
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.empty_function_parameters"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.empty_function_parameters" title="Empty Function Parameters">Empty
+ Function Parameters</a>
+</h4></div></div></div>
+<p>
+ The C++ preprocessor does not allow to specify an empty macro parameter
+ as a consequence preprocessor sequences cannot contain empty elements
+ <code class="computeroutput"><span class="special">()</span></code>. Therefore the following
+ parenthesized syntax for a function with no parameter <code class="computeroutput"><span class="keyword">void</span>
+ <span class="identifier">f</span><span class="special">()</span></code>
+ is not valid for the C++ preprocessor:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)()</span> <span class="comment">// Error, cannot use empty `()`.
+</span></pre>
+<p>
+ This syntax is instead valid for the C99 preprocessor because it can instead
+ accept empty macro parameter.
+ </p>
+<p>
+ C++ also allow to specify an empty parameter list using <code class="computeroutput"><span class="keyword">void</span></code>:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+</pre>
+<p>
+ This leads to the valid parenthesized syntax:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ In summary:
+ </p>
+<div class="table">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.empty_function_parameters.empty_function_parameters"></a><p class="title"><b>Table&#160;3.&#160;Empty Function Parameters</b></p>
+<div class="table-contents"><table class="table" summary="Empty Function Parameters">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Parenthesized Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99-Only Parenthesized Syntax
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">)</span>
+ <span class="comment">// Authors' choice.</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)()</span>
+ <span class="comment">// Authors' choice.</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break">
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values" title="Default Parameter Values">Default
+ Parameter Values</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.function_name__result__inline__etc">Function
+ Name, Result, Inline, Etc</a></span></dt>
+<dt><span class="section"><a href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.variable_binding">Variable
+ Binding</a></span></dt>
+</dl></div>
+<p>
+ C++ does not allow to specify default parameter values within function
+ types thus the following is not valid:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="comment">// Error, can't specify default parameters within function types.
+</span></pre>
+<p>
+ Therefore, the following parenthesized syntax cannot be used:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ Because:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ It does not allow to strip the default parameter values from the parameter
+ type and name in order to construct and manipulate the local function
+ type.
+ </li>
+<li class="listitem">
+ Default parameter values are not part of the type so it is not possible
+ to program a metafunction that counts the number of default parameter
+ values at compile-time but such information is also needed by the local
+ functions in order to properly support default parameters. <sup>[<a name="id900828" href="#ftn.id900828" class="footnote">23</a>]</sup>
+ </li>
+</ol></div>
+<p>
+ Default parameters can be separated by the rest of the parameter expression
+ using:
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ Or using the more general parameter type/name form (even if not strictly
+ needed by local functions):
+ </p>
+<pre class="programlisting"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span>
+</pre>
+<p>
+ Note that the <code class="computeroutput"><span class="special">=</span></code> symbol needs
+ to be replaced with the alphanumeric keyword <code class="computeroutput"><span class="keyword">default</span></code>
+ because parenthesized syntax elements cannot start with a non alphanumeric
+ symbol like <code class="computeroutput"><span class="special">=</span></code>. <sup>[<a name="id901227" href="#ftn.id901227" class="footnote">24</a>]</sup>
+ </p>
+<p>
+ For C99, some or all the parenthesis can be replaced by commas.
+ </p>
+<div class="table">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.default_parameter_values"></a><p class="title"><b>Table&#160;4.&#160;Default Parameter Values</b></p>
+<div class="table-contents"><table class="table" summary="Default Parameter Values">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Normal C++ Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C++ Parenthesized Syntax
+ </p>
+ </th>
+<th>
+ <p>
+ C99-Only Parenthesized Syntax
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">inx</span>
+ <span class="identifier">x</span> <span class="special">=</span>
+ <span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="keyword">double</span>
+ <span class="identifier">y</span> <span class="special">=</span>
+ <span class="special">-</span><span class="number">1.23</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span>
+ <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span>
+ <span class="special">)</span></code> <span class="emphasis"><em>-or-</em></span>
+ </p>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span>
+ <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span>
+ <span class="special">)</span> <span class="comment">// Authors'
+ choice.</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">default</span>
+ <span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="keyword">double</span>
+ <span class="identifier">y</span><span class="special">,</span>
+ <span class="keyword">default</span> <span class="special">-</span><span class="number">1.23</span><span class="special">)</span></code>
+ <span class="emphasis"><em>-or-</em></span> <code class="computeroutput"><span class="comment">// Authors'
+ choice.</span></code>
+ </p>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">,</span>
+ <span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">,</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span>
+ <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span></code>
+ <span class="emphasis"><em>-or-</em></span>
+ </p>
+ <p>
+ <code class="computeroutput"><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">(</span><span class="identifier">f</span><span class="special">)(</span>
+ <span class="special">(</span><span class="keyword">int</span>
+ <span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">,</span> <span class="special">(</span><span class="keyword">double</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span>
+ <span class="special">-</span><span class="number">1.23</span><span class="special">)</span> <span class="special">)</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ Default parameter values are probably most useful to overload a public
+ API. Therefore, it is not clear how beneficial they are for local functions
+ which will never be publicly available to caller because they are always
+ hidden within the enclosing scope by definition. Nevertheless, it seems
+ appropriate for local functions to support default parameter values given
+ that it is technically possible and let programmers decide when and if
+ to leverage such a feature.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.function_name__result__inline__etc"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.function_name__result__inline__etc" title="Function Name, Result, Inline, Etc">Function
+ Name, Result, Inline, Etc</a>
+</h5></div></div></div>
+<p>
+ Motivated by the C99-only simplified syntax, we note that if the local
+ function name and result type could be omitted from the local function
+ declaration, the macro invocation will be greatly simplified (using no
+ extra parenthesis at all):
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// No extra parenthesis at all!
+</span> <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+<span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">1.23</span><span class="special">);</span>
+</pre>
+<p>
+ And for non-C99 preprocessors:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span>
+<span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">1.23</span><span class="special">);</span>
+</pre>
+<p>
+ However, the above syntax introduces the following limitations:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Recursive local functions are not possible if the function name is
+ not specified within the function declaration (because the declaration
+ macro expansion cannot define a factor with the local function name
+ before the body is specified given that the function name is only
+ specified by the end macro after the body).
+ </li>
+<li class="listitem">
+ The library will require the use of Boost.Typeof to deduce the result
+ type (because it is now specified outside the declaration macro)
+ even when no variable is bound to the local function.
+ </li>
+</ul></div>
+<p>
+ The Boost.Typeof requirements might not be a big limitation however now
+ allowing recursive function calls would be a major limitation -- for
+ example, the following will not be possible:
+ </p>
+<pre class="programlisting"><span class="identifier">BOOST_LOCAL_FUNCTION</span><span class="special">(</span>
+<span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">(</span><span class="identifier">factorial</span><span class="special">)(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">)</span>
+<span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">n</span> <span class="special">&lt;</span> <span class="number">2</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+ <span class="keyword">else</span> <span class="keyword">return</span> <span class="identifier">n</span> <span class="special">*</span> <span class="identifier">factorial</span><span class="special">(</span><span class="identifier">n</span> <span class="special">-</span> <span class="number">1</span><span class="special">);</span> <span class="comment">// Recursive call.
+</span><span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_END</span><span class="special">(</span><span class="identifier">factorial</span><span class="special">)</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">factorial</span><span class="special">(</span><span class="number">10</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
+<p>
+ The library could provide a different macros <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span></code>
+ and <code class="computeroutput"><span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span></code>
+ to still support this syntax simplification at the cost of not allowing
+ recursion and requiring Boost.Typeof to deduce the result type. On C99
+ preprocessors:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+<span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">1.23</span><span class="special">);</span>
+</pre>
+<p>
+ And for non-C99 preprocessors:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)(</span><span class="identifier">x</span><span class="special">)</span> <span class="special">(</span><span class="keyword">double</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="special">...</span>
+<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span>
+<span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">1.23</span><span class="special">);</span>
+</pre>
+<p>
+ In summary:
+ </p>
+</div>
+<div class="section"><div class="titlepage"><div><div><h5 class="title">
+<a name="boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.variable_binding"></a><a class="link" href="Rationale.html#boost_local.Rationale.parenthesized_syntax_rationale.default_parameter_values.variable_binding" title="Variable Binding">Variable
+ Binding</a>
+</h5></div></div></div></div>
+</div>
+</div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a id="ftn.id900828" href="#id900828" class="para">23</a>] </sup>
+ Specifically, the number of default parameter value is needed at
+ compile-time to instantiate the proper <code class="computeroutput"><span class="identifier">function_ref</span><span class="special">&lt;</span><span class="keyword">typename</span>
+ <span class="identifier">F</span><span class="special">,</span>
+ <span class="identifier">size_t</span> <span class="identifier">default_parameter_count</span></code>
+ template to hold the local function. The <code class="computeroutput"><span class="identifier">function_ref</span></code>
+ functor is needed to implement the trick that allows local functions
+ to be passed as template parameters (see http://lists.boost.org/Archives/boost/2010/09/170888.php).
+ </p></div>
+<div class="footnote"><p><sup>[<a id="ftn.id901227" href="#id901227" class="para">24</a>] </sup>
+ This is because the parenthesized syntax needs to check if its token
+ matches a keyword like <code class="computeroutput"><span class="keyword">void</span></code>,
+ <code class="computeroutput"><span class="keyword">inline</span></code>, etc. This checking
+ is done by concatenating from the front the token with a special library-defined
+ symbol that generates a new macro that will ultimately expand to <code class="computeroutput"><span class="number">1</span></code> if and only if the element matches the
+ searched keyword. The preprocessor does not allow to concatenate non-alphanumeric
+ tokens so the parenthesized syntax tokens cannot start with a non-alphanumeric
+ token otherwise the concatenation will generate a preprocessor error
+ (see http://lists.boost.org/Archives/boost/2010/08/169859.php).
+ </p></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Lorenzo Caminiti<p>
+ 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).
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Releases.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Modified: sandbox/local/libs/local/doc/html/boost_local/Releases.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Releases.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Releases.html 2011-02-10 14:54:06 EST (Thu, 10 Feb 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="Examples.html" title="Appendix: Examples">
+<link rel="prev" href="Rationale.html" title="Appendix: Rationale">
 <link rel="next" href="Bibliography.html" title="Bibliography">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Rationale.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -89,7 +89,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="Examples.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
+<a accesskey="p" href="Rationale.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="Bibliography.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -186,7 +186,7 @@
 </h3></div></div></div>
 <p>
         The following symbols are part of the library private API, they are not documented,
- and they should not be directly used by programmers: <sup>[<a name="id864012" href="#ftn.id864012" class="footnote">1</a>]</sup>
+ and they should not be directly used by programmers: <sup>[<a name="id864005" href="#ftn.id864005" class="footnote">1</a>]</sup>
       </p>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
@@ -226,7 +226,7 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id864012" href="#id864012" class="para">1</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id864005" href="#id864005" class="para">1</a>] </sup>
           <span class="bold"><strong>Rationale.</strong></span> This library concatenates symbols
           specified by the programmers (e.g., the local function name) with other
           symbols (e.g., special prefixes or preprocessor line numbers) to make internal

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -67,17 +67,17 @@
           are:
         </p>
 <p>
- 1. Wrap all the signature syntactic elements within parenthesis <code class="computeroutput"><span class="special">()</span></code>. <sup>[<a name="id864335" href="#ftn.id864335" class="footnote">2</a>]</sup>
+ 1. Wrap all the signature syntactic elements within parenthesis <code class="computeroutput"><span class="special">()</span></code>. <sup>[<a name="id864328" href="#ftn.id864328" class="footnote">2</a>]</sup>
         </p>
 <p>
           2. If a token does not start with an alphanumeric symbol (i.e., <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>, or <code class="computeroutput"><span class="number">0</span><span class="special">-</span><span class="number">9</span></code>), replace
           the token with its alphanumeric equivalent (as indicated in the <a class="link" href="Grammar.html" title="Appendix: Grammar">Grammar</a>
- section). <sup>[<a name="id864462" href="#ftn.id864462" class="footnote">3</a>]</sup>
+ section). <sup>[<a name="id864455" href="#ftn.id864455" class="footnote">3</a>]</sup>
         </p>
 <p>
           3. Empty parenthesis <code class="computeroutput"><span class="special">()</span></code> are
- not allowed. <sup>[<a name="id864498" href="#ftn.id864498" class="footnote">4</a>]</sup>
+ not allowed. <sup>[<a name="id864491" href="#ftn.id864491" class="footnote">4</a>]</sup>
         </p>
 <p>
           4. Spaces and newlines do not matter and they can be used anywhere.
@@ -162,11 +162,11 @@
           (see the <a class="link" href="Grammar.html" title="Appendix: Grammar">Grammar</a> section). When
           syntactic errors can be detected by the parsing macros, they are raised
           at compile-time using error messages of the form <code class="computeroutput"><span class="identifier">ERROR_</span></code><span class="emphasis"><em>description_text</em></span>.
- <sup>[<a name="id865444" href="#ftn.id865444" class="footnote">5</a>]</sup>
+ <sup>[<a name="id865437" href="#ftn.id865437" class="footnote">5</a>]</sup>
         </p></td></tr>
 </table></div>
 <a name="boost_local.Tutorial.parenthesized_syntax.functions_with_no_parameters"></a><h6>
-<a name="id865483"></a>
+<a name="id865476"></a>
         <a class="link" href="Tutorial.html#boost_local.Tutorial.parenthesized_syntax.functions_with_no_parameters">Functions
         With No Parameters</a>
       </h6>
@@ -262,12 +262,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="id865976" href="#ftn.id865976" class="footnote">6</a>]</sup>
+ usual meaning. <sup>[<a name="id865969" href="#ftn.id865969" class="footnote">6</a>]</sup>
           </li>
 <li class="listitem">
             The macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_END.html" title="Macro BOOST_LOCAL_FUNCTION_END">BOOST_LOCAL_FUNCTION_END</a></code>
             is used to end the local function definition and it must repeat the local
- function name. <sup>[<a name="id866010" href="#ftn.id866010" class="footnote">7</a>]</sup> The compiler will generate an error if the name specified
+ function name. <sup>[<a name="id866003" href="#ftn.id866003" class="footnote">7</a>]</sup> The compiler will generate an error if the name specified
             by this macro does not match the one from the local function signature
             (see <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_END_RENAME.html" title="Macro BOOST_LOCAL_FUNCTION_END_RENAME">BOOST_LOCAL_FUNCTION_END_RENAME</a></code>
             to remove this constraint).
@@ -333,7 +333,7 @@
         be bound by reference, by constant reference, by value, or by constant value.
         The types of bound variables are automatically deduced by this library using
         <a href="http://www.boost.org/doc/libs/release/doc/html/typeof.html" target="_top">Boost.Typeof</a>.
- <sup>[<a name="id866628" href="#ftn.id866628" class="footnote">8</a>]</sup>
+ <sup>[<a name="id866621" href="#ftn.id866621" class="footnote">8</a>]</sup>
       </p>
 <div class="important"><table border="0" summary="Important">
 <tr>
@@ -435,13 +435,13 @@
 <p>
       </p>
 <a name="boost_local.Tutorial.binding.constant_binding"></a><h6>
-<a name="id867562"></a>
+<a name="id867555"></a>
         <a class="link" href="Tutorial.html#boost_local.Tutorial.binding.constant_binding">Constant Binding</a>
       </h6>
 <p>
         Constant binding allows to bind variables in scope by constant reference
         or constant value (constant binding 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="id867586" href="#ftn.id867586" class="footnote">9</a>]</sup>
+ lambda</a> functions). <sup>[<a name="id867580" href="#ftn.id867580" class="footnote">9</a>]</sup>
       </p>
 <p>
         The parenthesized syntax uses the "keywords" <code class="computeroutput"><span class="keyword">const</span>
@@ -516,7 +516,7 @@
 <p>
       </p>
 <a name="boost_local.Tutorial.binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_"></a><h6>
-<a name="id868889"></a>
+<a name="id868895"></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>
@@ -565,10 +565,10 @@
           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="id869243" href="#ftn.id869243" class="footnote">10</a>]</sup> Using <code class="computeroutput"><span class="keyword">this</span></code> within
+ the bound object. <sup>[<a name="id869250" href="#ftn.id869250" class="footnote">10</a>]</sup> Using <code class="computeroutput"><span class="keyword">this</span></code> within
           the local function body will generate a compile-time error so programmers
           cannot mistakenly confuse the use of <code class="computeroutput"><span class="identifier">this_</span></code>
- with <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id869342" href="#ftn.id869342" class="footnote">11</a>]</sup>
+ with <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id869349" href="#ftn.id869349" class="footnote">11</a>]</sup>
         </p></td></tr>
 </table></div>
 <p>
@@ -681,7 +681,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 scope</strong></span>.
- <sup>[<a name="id870864" href="#ftn.id870864" class="footnote">12</a>]</sup>
+ <sup>[<a name="id870874" href="#ftn.id870874" class="footnote">12</a>]</sup>
         </p></td></tr>
 </table></div>
 <p>
@@ -782,7 +782,7 @@
 <p>
         Local exits are very similar to the functionality already provided by Boost.ScopeExit
         with the addition that they also support constant binding and the binding
- of the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id872160" href="#ftn.id872160" class="footnote">13</a>]</sup>
+ of the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id872167" href="#ftn.id872167" class="footnote">13</a>]</sup>
       </p>
 </div>
 <div class="section">
@@ -793,7 +793,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="id872510" href="#ftn.id872510" class="footnote">14</a>]</sup>
+ the Reference section): <sup>[<a name="id872518" href="#ftn.id872518" class="footnote">14</a>]</sup>
       </p>
 <pre class="programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_TPL">BOOST_LOCAL_FUNCTION_TPL</a></code><span class="special">(</span> <span class="emphasis"><em>parenthesized-signature</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>parenthesized-binding</em></span> <span class="special">)</span>
@@ -856,7 +856,7 @@
 </div>
 <div class="footnotes">
 <br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id864335" href="#id864335" class="para">2</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id864328" href="#id864328" class="para">2</a>] </sup>
             The parenthesized syntax owes its name to the indeed large number of
             parenthesis <code class="computeroutput"><span class="special">()</span></code> that are
             required to wrap its elements. Programmers might notice some similarities
@@ -867,17 +867,17 @@
             sequences and Boost.Preprocessor
             sequences are formed by wrapping tokens within round parenthesis <code class="computeroutput"><span class="special">()</span></code>.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id864462" href="#id864462" class="para">3</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id864455" href="#id864455" class="para">3</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> This constraint comes form
             the fact that the C++ preprocessor can only concatenate <code class="literal">##</code>
             alphanumeric symbols.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id864498" href="#id864498" class="para">4</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id864491" href="#id864491" class="para">4</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> This constraint comes from
             the fact that the ISO C++ standard preprocessor forbids empty macro parameters
             (this is different for C99 and other more recent preprocessors).
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id865444" href="#id865444" class="para">5</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id865437" href="#id865437" class="para">5</a>] </sup>
             While there are fundamental limitations to the amount of parenthesized
             syntax error checking that can be done using the preprocessor (e.g.,
             there is no way to gracefully detect and report a missing parenthesis
@@ -888,14 +888,14 @@
             messages they experience because of parenthesized syntax errors so to
             help this development effort.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id865976" href="#id865976" class="para">6</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id865969" href="#id865969" class="para">6</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.id866010" href="#id866010" class="para">7</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id866003" href="#id866003" class="para">7</a>] </sup>
               <span class="bold"><strong>Rationale.</strong></span> The local function name
               must be passed to the ending macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_END.html" title="Macro BOOST_LOCAL_FUNCTION_END">BOOST_LOCAL_FUNCTION_END</a></code>
               so this macro can declare a local variable with the local function
@@ -907,7 +907,7 @@
               (otherwise, the compiler error line numbers will all appear on the
               same line and they will no longer be useful to pinpoint the errors).
             </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id866628" href="#id866628" class="para">8</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id866621" href="#id866621" class="para">8</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,
@@ -920,7 +920,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.id867586" href="#id867586" class="para">9</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id867580" href="#id867580" class="para">9</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
@@ -935,7 +935,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.id869243" href="#id869243" class="para">10</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id869250" href="#id869250" class="para">10</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
@@ -949,11 +949,11 @@
             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.id869342" href="#id869342" class="para">11</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id869349" href="#id869349" class="para">11</a>] </sup>
             <span class="bold"><strong>Rationale.</strong></span> This is because the body
             function is implemented as static function of the local functor class.
           </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id870864" href="#id870864" class="para">12</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id870874" href="#id870874" class="para">12</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),
@@ -971,7 +971,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.id872160" href="#id872160" class="para">13</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id872167" href="#id872167" 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"
@@ -998,7 +998,7 @@
           local functions are not known under the name of "scope functions"
           (they are indeed known by the name of "local functions" or "nested functions").
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id872510" href="#id872510" class="para">14</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.id872518" href="#id872518" 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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -23,11 +23,11 @@
 <div><h2 class="title">
 <a name="boost_local"></a>Boost.Local 0.1.1 </h2></div>
 <div><div class="authorgroup"><div class="author"><h3 class="author">
-<span class="firstname">Lorenzo</span> <span class="surname">Caminiti</span>
+<span class="firstname">Lorenzo</span> <span class="surname">Caminiti (lorcaminiti_at_[hidden])</span>
 </h3></div></div></div>
 <div><p class="copyright">Copyright &#169; 2009 -2011 Lorenzo Caminiti</p></div>
 <div><div class="legalnotice">
-<a name="id807693"></a><p>
+<a name="id809057"></a><p>
         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).
       </p>
@@ -44,6 +44,7 @@
 <dt><span class="section">Appendix: Grammar</span></dt>
 <dt><span class="section">Appendix: Alternatives</span></dt>
 <dt><span class="section">Appendix: Examples</span></dt>
+<dt><span class="section">Appendix: Rationale</span></dt>
 <dt><span class="section">Releases</span></dt>
 <dt><span class="section">Bibliography</span></dt>
 <dt><span class="section">Acknowledgments</span></dt>
@@ -112,7 +113,7 @@
         </li>
 </ul></div>
 <a name="boost_local.Introduction.an_example"></a><h6>
-<a name="id807257"></a>
+<a name="id809432"></a>
       <a class="link" href="index.html#boost_local.Introduction.an_example">An Example</a>
     </h6>
 <p>
@@ -299,7 +300,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: January 11, 2011 at 14:15:21 GMT</small></p></td>
+<td align="left"><p><small>Last revised: February 10, 2011 at 15:15:01 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/local/libs/local/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/local/libs/local/doc/html/standalone_HTML.manifest (original)
+++ sandbox/local/libs/local/doc/html/standalone_HTML.manifest 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -21,6 +21,7 @@
 boost_local/Grammar.html
 boost_local/Alternatives.html
 boost_local/Examples.html
+boost_local/Rationale.html
 boost_local/Releases.html
 boost_local/Bibliography.html
 boost_local/Acknowledgments.html

Modified: sandbox/local/libs/local/doc/jamfile.jam
==============================================================================
--- sandbox/local/libs/local/doc/jamfile.jam (original)
+++ sandbox/local/libs/local/doc/jamfile.jam 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -34,6 +34,7 @@
         <dependency>qbk/grammar.qbk
         <dependency>qbk/alternatives.qbk
         <dependency>qbk/examples.qbk
+ <dependency>qbk/rationale.qbk
         <dependency>qbk/releases.qbk
         <dependency>qbk/bibliography.qbk
         <dependency>qbk/acknowledgements.qbk

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-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -8,9 +8,9 @@
 [preface Boost.Local
     [quickbook 1.5]
     [version 0.1.1 ]
- [/ purpose Local functions for C++]
- [/ category Function objects and higher-order programming]
- [authors [Caminiti, Lorenzo]]
+ [/ purpose Local functions, blocks, and exits for C++]
+ [/ category Function Objects and Higher-Order Programming]
+ [authors [Caminiti (lorcaminiti_at_[hidden]), Lorenzo]]
     [copyright 2009-2011 Lorenzo Caminiti]
     [license
         Use, modification, and distribution is subject to the
@@ -92,6 +92,7 @@
 [include grammar.qbk]
 [include alternatives.qbk]
 [include examples.qbk]
+[include rationale.qbk]
 [include releases.qbk]
 [include bibliography.qbk]
 [include acknowledgements.qbk]

Added: sandbox/local/libs/local/doc/qbk/rationale.qbk
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/doc/qbk/rationale.qbk 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,545 @@
+
+[section:Rationale Appendix: Rationale]
+
+This section discusses rationale behind library design decisions in addition to the rationale already provided throughout the rationale footnotes in the rest of this documentation.
+
+[section Parenthesized Syntax Rationale]
+
+This section discusses the rationale behind parenthesized syntax design decisions.
+
+[section C99 Preprocessor]
+
+The C99 preprocessor (and therefore the C++0x preprocessor) allows for additional features like specifying empty macro parameters and variadic macro parameters which are not supported by the ISO C++ standard preprocessor.
+The additional features of the C99 preprocessor can be used to simplify the parenthesized syntax mainly by removing extra parenthesis and making it look more like normal C++ syntax.
+
+Most (and maybe all) modern compilers support the C99 preprocessor at this time and all new C++0x compilers will support the C99 preprocessor in the future.
+Therefore, the library macros have been programmed to automatically detect the presence of the C99 preprocessor and accept the simplified parenthesized syntax in these cases.
+The same macro will only accept the parenthesized syntax on non C99 preprocessor but will accept both the parenthesized syntax and the simplified parenthesized syntax on C99 preprocessors.
+This way, programmers that can afford to write C99 specific code can benefit from the simplifications of the parenthesized syntax.
+
+[table
+[ [
+Function Feature
+] [
+Normal C++ Syntax
+] [
+Simplified Parenthesized Syntax (C99 only)
+] [
+Parenthesized Syntax (both C++ and C99)
+] ]
+
+[ [
+/Empty Parameter List/
+] [
+``
+ void f() {
+ ...
+ }
+``
+Or:
+``
+ void f(void) {
+ ...
+ }
+``
+] [
+Using empty macro parameter:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)()
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ // No extra parenthesis at all!
+ void BOOST_LOCAL_FUNCTION_PARAMS() {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME_END(f)
+``
+] [
+Using `void` parameter list:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)( (void) )
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ void BOOST_LOCAL_FUNCTION_PARAMS( (void) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME_END(f)
+``
+] ]
+
+[ [
+/Parameter Types and Names/
+] [
+``
+ void f(int x, double& y) {
+ ...
+ }
+``
+Local functions do not need to access the parameter names separately from their types so they are merged into a single token (even if that reduces the generality of the syntax).
+] [
+Merging parameter type with its name and using variable length tuples:
+``
+ BOOST_LOCAL_FUNCTION(
+ // Parameter list syntax same as normal.
+ (void) (f)(int x, double& y)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ // No extra parenthesis at all!
+ void BOOST_LOCAL_FUNCTION_PARAMS(int x, double& y) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] [
+Merging parameter type with its name and using sequences:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)( (int x) (double& y)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ void BOOST_LOCAL_FUNCTION_PARAMS( (int x) (double& y) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] ]
+
+[ [
+/Parameter Defaults/
+] [
+``
+ void f(int x = -1,
+ double y = -1.23) {
+ ...
+ }
+``
+Parameter defaults need to be separated from their types and names because they cannot be part of function type expressions.
+The symbol `=` cannot be used because it is not alphanumeric so `default` is used instead.
+] [
+Using `default` instead of `=` and variable length tuples:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)(int x, default -1,
+ double y, default -1.23)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ // No extra parenthesis needed.
+ void BOOST_LOCAL_FUNCTION_PARAMS(int x, default -1,
+ double y, default -1.23) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] [
+Using `default` instead of `=` and sequences:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)( (int x)(default -1)
+ (double y)(default -1.23) )
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ void BOOST_LOCAL_FUNCTION_PARAMS( (int x)(default -1)
+ (double y)(default -1.23) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] ]
+
+[ [
+/Variable Binding/
+] [
+Not supported by C++ (supported by C++0x via lambda functions).
+``
+int a = 0, b = 1, c = 2, d = 3;
+void f(int x) /* bind a, b, c, d somehow... */ {
+ ...
+}
+``
+] [
+Using `bind` and `const bind` instead of the parameter type and variable length typles:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)(int x, bind a, const bind b, bind& c, const bind& d)
+ ) {
+ ...
+ ) BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ // No extra parenthesis needed.
+ void BOOST_LOCAL_FUNCTION_PARAMS(int x, bind a, const bind b,
+ bind& c, const bind& d) {
+ ...
+ ) BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] [
+Using `bind` and `const bind` instead of the parameter type:
+``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)(int x, bind a, const bind b, bind& c, const bind& d)
+ ) {
+ ...
+ ) BOOST_LOCAL_FUNCTION_END(f)
+``
+But also when no recursion and Boost.Typeof for result type:
+``
+ // No extra parenthesis needed.
+ void BOOST_LOCAL_FUNCTION_PARAMS(int x, bind a, const bind b,
+ bind& c, const bind& d) {
+ ...
+ ) BOOST_LOCAL_FUNCTION_NAME(f)
+``
+] ]
+
+]
+
+[table
+ [
+ [ Feature ]
+ [ Normal C++ Syntax ]
+ [ C99 Split Syntax ]
+ [ C99 Parenthesized Syntax ]
+ [ C++ Split Syntax ]
+ [ C++ Parenthesized Syntax ]
+ ]
+ [
+ [ Use variadics macro parameters (limitation -- C99 preprocessor only). ]
+ [ ]
+ [ Yes. ]
+ [ Yes. ]
+ [ No. ]
+ [ No. ]
+ ]
+ [
+ [ Use empty macro parameter (limitation -- C99 preprocessor only). ]
+ [ ]
+ [ Yes. ]
+ [ Yes. ]
+ [ No. ]
+ [ No. ]
+ ]
+ [
+ [ Support recursive local function calls. ]
+ [ ]
+ [ No. ]
+ [ Yes. ]
+ [ No. ]
+ [ Yes. ]
+ ]
+ [
+ [ Always require Boost.Type of for result type (limitation). ]
+ [ ]
+ [ Yes. ]
+ [ No. ]
+ [ Yes. ]
+ [ No. ]
+ ]
+ [
+ [ Support `inline` local functions. ]
+ [ ]
+ [ No. ]
+ [ Yes. ]
+ [ No. ]
+ [ Yes. ]
+ ]
+ [
+ [ /Empty parameter list./ ]
+ [``
+ void f() {
+ ...
+ }
+ ``
+ Or:
+ ``
+ void f(void) {
+ ...
+ }
+ ``]
+ [``
+ void BOOST_LOCAL_FUNCTION_PARAMS() {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ ``]
+ [``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)()
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ ``]
+ [``
+ void BOOST_LOCAL_FUNCTION_PARAMS( (void) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ ``]
+ [``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)( (void) )
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ ``]
+ ]
+ [
+ [ /Parameter types and names./ ]
+ [``
+ void f(int x, double y) {
+ ...
+ }
+ ``]
+ [``
+ void BOOST_LOCAL_FUNCTION_PARAMS(
+ int x, double y) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ ``]
+ [``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)(int x, double y)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ ``]
+ [``
+ void BOOST_LOCAL_FUNCTION_PARAMS(
+ (int x) (double y) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ ``]
+ [``
+ BOOST_LOCAL_FUNCTION(
+ (void) (f)( (int x) (double y) )
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ ``]
+ ]
+]
+
+[endsect]
+
+[section Parameter Type and Name Separation]
+
+C++ allows to specify parameter names within function types:
+
+ void (int x, double& y)
+
+Therefore, the parenthesized syntax for local functions does not have to separate the function parameter type and name tokens:
+
+[table Parameter Types and Names
+[ [Normal C++ Syntax] [C++ Parenthesized Syntax] [C99-Only Parenthesized Syntax] ]
+[ [
+`void f(int x, double&y)`
+] [
+`(void) (f)( (int x) (double& y) ) // Is this better than its general version below selected by the authors? Local functions don't need the generality...`
+] [
+`(void) (f)(int x, double& y) // Authors' choice.`
+] ]
+]
+
+Note that a more general form of the parenthesized syntax would have been instead:
+[table Separated Parameter Types and Names
+[ [Normal C++ Syntax] [C++ Parenthesized Syntax] [C99-Only Parenthesized Syntax] ]
+[ [
+`void f(int x, double& y)`
+] [
+`(void) (f)( (int)(x) (double&)(y) ) // Authors' choice.`
+] [
+`(void) (f)(int, x, double&, y)` /-or-/
+
+`(void) (f)( (int, x) , (double&, y) )` /-or-/
+
+`(void) (f)( (int)(x) , (double&)(y) )`
+] ]
+]
+
+This more general form makes available the parameter types and names as separate tokens for preprocessor metaprogramming.
+In fact, there is no way for the preprocessor to split `(int x)` into the parameter type `int` and name `x` while it can split `(int)(x)`.
+The parameter types can be split at compile-time (for example to force some parameters to be constant, references, etc):
+
+ typedef arg_type<void (int x, double& y), 0>::type arg_type0; // int
+ typedef arg_type<void (int x, double& y), 1>::type arg_type1; // double&
+
+But the parameter name `x` remains inaccessible as a token separately from its type.
+However, local function do not need to access parameter types separately from their types so this lack of generality is not an issue for local function and the less general syntax (e.g., `(int x)`) is preferred over the more general one (e.g., `(int)(x)`) because it is simpler as it uses a smaller number of parenthesis and resembles more closely the normal C++ syntax for function parameters.
+
+[note *Overloaded functions.*
+An example where parameter names need to be accessed separately from their types is to support overloading.
+For example, if the macro need to expand to support code for an overloaded function, they might need to generate unique identifiers for symbols within the support code.
+Assume also `__LINE__` cannot be used in this context because the unique identifiers need to be referred by another macro expanding on a different line (so the unique identifier need to be generated upon the function syntactic elements -- function name, parameter names, etc).
+Such identifiers cannot simply use the function name because the same function name is used multiple times when the function is overloaded and therefore the identifiers will not be unique.
+The parameter names can be concatenated by the preprocessor together with the function name to generate such unique identifiers (with the limitation that overloaded function need to used different parameter names and not just different parameter types).
+]
+
+[endsect]
+
+[section Empty Function Parameters]
+
+The C++ preprocessor does not allow to specify an empty macro parameter as a consequence preprocessor sequences cannot contain empty elements `()`.
+Therefore the following parenthesized syntax for a function with no parameter `void f()` is not valid for the C++ preprocessor:
+
+ (void) (f)() // Error, cannot use empty `()`.
+
+This syntax is instead valid for the C99 preprocessor because it can instead accept empty macro parameter.
+
+C++ also allow to specify an empty parameter list using `void`:
+
+ void f(void)
+
+This leads to the valid parenthesized syntax:
+
+ (void) (f)( (void) )
+
+In summary:
+
+[table Empty Function Parameters
+[ [Normal C++ Syntax] [C++ Parenthesized Syntax] [C99-Only Parenthesized Syntax] ]
+[ [
+`void f()`
+] [
+`(void) (f)( (void) ) // Authors' choice.`
+] [
+`(void) (f)() // Authors' choice.`
+] ]
+]
+
+[endsect]
+
+[section Default Parameter Values]
+
+C++ does not allow to specify default parameter values within function types thus the following is not valid:
+
+ void (int x = -1, double y = -1.23) // Error, can't specify default parameters within function types.
+
+Therefore, the following parenthesized syntax cannot be used:
+
+ (void) (f)( (int x = -1) (double y = -1.23) )
+
+Because:
+
+# It does not allow to strip the default parameter values from the parameter type and name in order to construct and manipulate the local function type.
+# Default parameter values are not part of the type so it is not possible to program a metafunction that counts the number of default parameter values at compile-time but such information is also needed by the local functions in order to properly support default parameters.
+[footnote
+Specifically, the number of default parameter value is needed at compile-time to instantiate the proper `function_ref<typename F, size_t default_parameter_count` template to hold the local function.
+The `function_ref` functor is needed to implement the trick that allows local functions to be passed as template parameters (see [@http://lists.boost.org/Archives/boost/2010/09/170888.php]).
+]
+
+Default parameters can be separated by the rest of the parameter expression using:
+
+ (void) (f)( (int x)(default -1) (double y)(default -1.23) )
+
+Or using the more general parameter type/name form (even if not strictly needed by local functions):
+
+ (void) (f)( (int)(x)(default -1) (double)(y)(default -1.23) )
+
+Note that the `=` symbol needs to be replaced with the alphanumeric keyword `default` because parenthesized syntax elements cannot start with a non alphanumeric symbol like `=`.
+[footnote
+This is because the parenthesized syntax needs to check if its token matches a keyword like `void`, `inline`, etc.
+This checking is done by concatenating from the front the token with a special library-defined symbol that generates a new macro that will ultimately expand to `1` if and only if the element matches the searched keyword.
+The preprocessor does not allow to concatenate non-alphanumeric tokens so the parenthesized syntax tokens cannot start with a non-alphanumeric token otherwise the concatenation will generate a preprocessor error (see [@http://lists.boost.org/Archives/boost/2010/08/169859.php]).
+]
+
+For C99, some or all the parenthesis can be replaced by commas.
+
+[table Default Parameter Values
+[ [Normal C++ Syntax] [C++ Parenthesized Syntax] [C99-Only Parenthesized Syntax] ]
+[ [
+`void f(inx x = -1, double y = -1.23)`
+] [
+`(void) (f)( (int x)(default -1) (double y)(default -1.23) )` /-or-/
+
+`(void) (f)( (int)(x)(default -1) (double)(y)(default -1.23) ) // Authors' choice.`
+] [
+`(void) (f)(int x, default -1, double y, default -1.23)` /-or-/ `// Authors' choice.`
+
+`(void) (f)( (int x, default -1) , (double y, default -1.23) )` /-or-/
+
+`(void) (f)( (int x)(default -1) , (double y)(default -1.23) )`
+] ]
+]
+
+Default parameter values are probably most useful to overload a public API.
+Therefore, it is not clear how beneficial they are for local functions which will never be publicly available to caller because they are always hidden within the enclosing scope by definition.
+Nevertheless, it seems appropriate for local functions to support default parameter values given that it is technically possible and let programmers decide when and if to leverage such a feature.
+
+[section Function Name, Result, Inline, Etc]
+
+Motivated by the C99-only simplified syntax, we note that if the local function name and result type could be omitted from the local function declaration, the macro invocation will be greatly simplified (using no extra parenthesis at all):
+
+ void BOOST_LOCAL_FUNCTION(int x, double y) { // No extra parenthesis at all!
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ f(1, 1.23);
+
+And for non-C99 preprocessors:
+
+ void BOOST_LOCAL_FUNCTION( (int)(x) (double)(y) ) {
+ ...
+ }
+ f(1, 1.23);
+
+However, the above syntax introduces the following limitations:
+
+* Recursive local functions are not possible if the function name is not specified within the function declaration (because the declaration macro expansion cannot define a factor with the local function name before the body is specified given that the function name is only specified by the end macro after the body).
+* The library will require the use of Boost.Typeof to deduce the result type (because it is now specified outside the declaration macro) even when no variable is bound to the local function.
+
+The Boost.Typeof requirements might not be a big limitation however now allowing recursive function calls would be a major limitation -- for example, the following will not be possible:
+
+ BOOST_LOCAL_FUNCTION(
+ (int) (factorial)(int n)
+ ) {
+ if (n < 2) return 1;
+ else return n * factorial(n - 1); // Recursive call.
+ } BOOST_LOCAL_FUNCTION_END(factorial)
+ std::cout << factorial(10) << std::endl;
+
+The library could provide a different macros `BOOST_LOCAL_FUNCTION_PARAMS` and `BOOST_LOCAL_FUNCTION_NAME` to still support this syntax simplification at the cost of not allowing recursion and requiring Boost.Typeof to deduce the result type.
+On C99 preprocessors:
+
+ void BOOST_LOCAL_FUNCTION_PARAMS(int x, double y) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ f(1, 1.23);
+
+And for non-C99 preprocessors:
+
+ void BOOST_LOCAL_FUNCTION_PARAMS( (int)(x) (double)(y) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_NAME(f)
+ f(1, 1.23);
+
+In summary:
+
+
+[endsect]
+
+[section Variable Binding]
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[endsect]
+

Added: sandbox/local/libs/local/simpler_syntax/00.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/00.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,12 @@
+void BOOST_LOCAL_FUNCTION_PARAMS(
+ (double& x) (auto int y)(default -1) (register int z)(default -2)
+ (bind a) (bind& b) (const bind c) (const bind& d) ) {
+ y = x;
+} BOOST_LOCAL_FUNCTION_NAME(f)
+ int x
+double& y
+ -1
+1
+1
+ (bind a) (bind& b)
+ (const bind c) (const bind& d)

Added: sandbox/local/libs/local/simpler_syntax/TODO.txt
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/TODO.txt 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,20 @@
+
+
+
+* Double check all local function syntax elements (from Grammar) -- auto, register, etc.
+
+* Rename is_xxx.hpp to xxx.hpp for all PP_KEYWORD and add the strip (leading) macros.
+
+
+
+* Send comments on variadic_macro_data:
+
+
+
+
+* Add comparison with Look at Alex-Steven's syntax to docs:
+ http://thread.gmane.org/gmane.comp.lib.boost.devel/168612/focus=168694
+ >> This syntax uses same typeof trick to deduce result type.
+ >> This syntax uses a strange macro-into-macro for bind. I don't.
+
+

Added: sandbox/local/libs/local/simpler_syntax/add_nim_factor_sum_nomacros.01.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/add_nim_factor_sum_nomacros.01.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,100 @@
+
+#include <boost/local/function.hpp>
+#include <iostream>
+
+int main() {
+ double sum = 0.0;
+ int factor = 10;
+
+ // Determine bound parameter types via Boost.Typeof (from Boost.ScopeExit).
+
+ typedef void (*boost_se_tag_0_add20)(int factor );
+ typedef void (*boost_se_tag_1_add20)(int &sum );
+
+ typedef __typeof__(
+ boost::type_of::ensure_obj(
+ boost::scope_exit::aux::wrap(
+ boost::scope_exit::aux::deref(
+ factor
+ , (boost_se_tag_0_add20)0
+ )
+ )
+ )
+ ) boost_se_wrapped_t_0_add20;
+ typedef boost_se_wrapped_t_0_add20::type boost_se_capture_t_0_add20;
+
+ typedef __typeof__(
+ boost::type_of::ensure_obj(
+ boost::scope_exit::aux::wrap(
+ boost::scope_exit::aux::deref(
+ &sum
+ , (boost_se_tag_1_add20)0
+ )
+ )
+ )
+ ) boost_se_wrapped_t_1_add20;
+ typedef boost_se_wrapped_t_1_add20::type boost_se_capture_t_1_add20;
+
+ struct boost_se_params_t_add20 {
+ typedef boost_se_capture_t_0_add20 boost_se_param_t_0_add20;
+ typedef boost_se_capture_t_1_add20 boost_se_param_t_1_add20;
+ boost::scope_exit::aux::member<
+ boost_se_param_t_0_add20
+ , boost_se_tag_0_add20
+ > boost_se_param_0_add20;
+ boost::scope_exit::aux::member<
+ boost_se_param_t_1_add20
+ , boost_se_tag_1_add20
+ > boost_se_param_1_add20;
+ } boost_local_auxXparams_add20 = {
+ { boost::scope_exit::aux::deref(factor, (boost_se_tag_0_add20)0) }
+ , { boost::scope_exit::aux::deref(&sum, (boost_se_tag_1_add20)0) }
+ };
+
+ boost::scope_exit::aux::declared<
+ boost::scope_exit::aux::resolve<
+ sizeof(boost_local_auxXargs)
+ >::cmp1<0>::cmp2
+ > boost_local_auxXargs;
+ boost_local_auxXargs.value = &boost_local_auxXparams_add20;
+
+ // Local function.
+
+ typedef ::boost::local::function_ref< void ( double ) , 0 >
+ boost_local_auxXaddXref;
+ struct boost_local_auxXfunctorXadd :
+ ::boost::local::aux::function_base< void ( double ), 0> {
+ explicit boost_local_auxXfunctorXadd(void* bind_params) :
+ boost_local_auxXparams( (boost_se_params_t_add20*) bind_params)
+ {}
+ void operator()( double num ) {
+ return boost_local_auxXbody(
+ *this
+ , boost_local_auxXparams-> boost_se_param_0_add20.value
+ , boost_local_auxXparams-> boost_se_param_1_add20.value
+ , num
+ );
+ }
+ private:
+ boost_se_params_t_add20* boost_local_auxXparams;
+ static void boost_local_auxXbody(
+ boost_local_auxXfunctorXadd& add
+ , ::boost::add_const<
+ boost_se_params_t_add20:: boost_se_param_t_0_add20
+ >::type factor
+ , boost_se_params_t_add20:: boost_se_param_t_1_add20 &sum
+ , double num
+ ) { // The body.
+ sum += factor * num;
+ std::clog << "Summed: " << sum << std::endl;
+ }
+ // The END macro.
+ };
+ boost_local_auxXfunctorXadd boost_local_auxXobjectXadd(
+ boost_local_auxXargs.value);
+ boost_local_auxXaddXref add( boost_local_auxXobjectXadd);
+
+ add(100.0);
+ return 0;
+}
+

Added: sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.02.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.02.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,115 @@
+
+#include <boost/local/function.hpp>
+#include <boost/function_types/parameter_types.hpp>
+#include <boost/mpl/at.hpp>
+#include <iostream>
+
+int main() {
+ double sum = 0.0;
+ int factor = 10;
+
+ // Determine bound parameter types via Boost.Typeof (from Boost.ScopeExit).
+
+ typedef void (*boost_se_tag_0_add20)(int factor );
+ typedef void (*boost_se_tag_1_add20)(int &sum );
+
+ typedef typeof__(
+ boost::type_of::ensure_obj(
+ boost::scope_exit::aux::wrap(
+ boost::scope_exit::aux::deref(
+ factor
+ , (boost_se_tag_0_add20)0
+ )
+ )
+ )
+ ) boost_se_wrapped_t_0_add20;
+ typedef boost_se_wrapped_t_0_add20::type boost_se_capture_t_0_add20;
+
+ typedef typeof__(
+ boost::type_of::ensure_obj(
+ boost::scope_exit::aux::wrap(
+ boost::scope_exit::aux::deref(
+ &sum
+ , (boost_se_tag_1_add20)0
+ )
+ )
+ )
+ ) boost_se_wrapped_t_1_add20;
+ typedef boost_se_wrapped_t_1_add20::type boost_se_capture_t_1_add20;
+
+ struct boost_se_params_t_add20 {
+ typedef boost_se_capture_t_0_add20 boost_se_param_t_0_add20;
+ typedef boost_se_capture_t_1_add20 boost_se_param_t_1_add20;
+ boost::scope_exit::aux::member<
+ boost_se_param_t_0_add20
+ , boost_se_tag_0_add20
+ > boost_se_param_0_add20;
+ boost::scope_exit::aux::member<
+ boost_se_param_t_1_add20
+ , boost_se_tag_1_add20
+ > boost_se_param_1_add20;
+ } boost_local_auxXparams_add20 = {
+ { boost::scope_exit::aux::deref(factor, (boost_se_tag_0_add20)0) }
+ , { boost::scope_exit::aux::deref(&sum, (boost_se_tag_1_add20)0) }
+ };
+
+ boost::scope_exit::aux::declared<
+ boost::scope_exit::aux::resolve<
+ sizeof(boost_local_auxXargs)
+ >::cmp1<0>::cmp2
+ > boost_local_auxXargs;
+ boost_local_auxXargs.value = &boost_local_auxXparams_add20;
+
+ // Determine unbound parameter types (handle attached param type-name-dflt).
+ // F( (void) (f)(double num = -1.23, int x = 1) )
+ // or F( void, f, (double num = -1.23, int x = 1) )
+#define RESULT_TYPE void
+#define ARG0 double num = -1.23
+ typedef RESULT_TYPE (function_type_add20)(ARG0);
+ typedef boost::function_types::parameter_types<function_type_add20>::type
+ param_types_add20;
+ typedef boost::mpl::at_c<param_types_add20, 0>::type arg_type0_add20;
+
+ // Local function.
+
+ /** @todo Is there a (compile-time) way to count default params from a function type? If not, I need to separate the dflt so I count them at pp-time... */
+ typedef ::boost::local::function_ref< function_type_add20, 0 >
+ boost_local_auxXaddXref;
+ struct boost_local_auxXfunctorXadd :
+ ::boost::local::aux::function_base< function_type_add20, 0> {
+ explicit boost_local_auxXfunctorXadd(void* bind_params) :
+ boost_local_auxXparams( (boost_se_params_t_add20*) bind_params)
+ {}
+ // Generic param names because unseparated param type-name-dflt.
+ void operator()( arg_type0_add20 arg0 ) {
+ return boost_local_auxXbody(
+ *this
+ , boost_local_auxXparams-> boost_se_param_0_add20.value
+ , boost_local_auxXparams-> boost_se_param_1_add20.value
+ , arg0
+ );
+ }
+ private:
+ boost_se_params_t_add20* boost_local_auxXparams;
+ static void boost_local_auxXbody(
+ // I need to know the function name at the decl for recursion.
+ boost_local_auxXfunctorXadd& add
+ , ::boost::add_const<
+ boost_se_params_t_add20:: boost_se_param_t_0_add20
+ >::type factor
+ , boost_se_params_t_add20:: boost_se_param_t_1_add20 &sum
+ , ARG0
+ ) { // The body.
+ sum += factor * num;
+ std::clog << "Summed: " << sum << std::endl;
+ }
+ // The END macro.
+ };
+ boost_local_auxXfunctorXadd boost_local_auxXobjectXadd(
+ boost_local_auxXargs.value);
+ boost_local_auxXaddXref add( boost_local_auxXobjectXadd);
+
+ add(100.0);
+ return 0;
+}
+

Added: sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.03.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/add_num_factor_sum_nomacros.03.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,15 @@
+
+#include <boost/local/function.hpp>
+#include <boost/function_types/parameter_types.hpp>
+#include <boost/mpl/at.hpp>
+#include <iostream>
+
+int main() {
+ typedef void (func_type)(double num = -1.23);
+
+ typedef boost::function_types::parameter_types<func_type>::type param_types;
+ typedef boost::mpl::at_c<param_types, 0>::type arg_type0;
+
+ return 0;
+}
+

Added: sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.00.txt
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.00.txt 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,152 @@
+
+
+
+PRELIMINARY IDEAS TO SIMPLIFY THE PARENTHESIZED SYNTAX*
+
+Consider the following parenthesized syntax for local functions:
+
+ (void) (f)( (int)(x) (double&)(y) (const bind)((a)(&b)) (bind)((&c)(d)) ) // [0]
+
+The followings are possible ways to simply this syntax.
+
+(*) DISCLAIMER: I still don't know if any of the following alternative syntaxes really works because I have not tried to implement them yet. This is just a paper exercise to write down possible options before I start looking into their implementation.
+
+
+
+1 MERGING PARAMETER TYPE AND NAME (C++ preprocessor)
+
+Parameter names can be passed to function types so I can transform `int x` into `int`:
+
+ int x -[make function type]-> void (int x) -[get 1st parm type]-> int
+
+Type should allow me to simplify the parenthesized syntax (*) to:
+
+ (void) (f)( (int x) (double& y) (const bind)((a)(&b)) (bind)((&c)(d)) ) // [1]
+
+Note that the (unbound) parameter type and name are merged into a single sequence element.
+
+The following should also be possible:
+
+ (void) (f)( (int x) (double& y) (const bind a) (const bind& b) (bind& c) (bind d) ) // [1a]
+
+Is this simpler than [1]?
+
+
+
+2 TOWARD A NORMAL PARAMETER LIST (C99 preprocessor)
+
+Using variadic macros I _might_ be able to use a variable length tuple instead of a sequence to represent the function parameters:
+
+ (void) (f)(int x, double& y, const bind a, const bind& b, bind& c, bind d) // [2]
+
+This appear to be a great simplification because it is the exact same syntax used by C++ to declare function parameter!
+
+Note that `const bind` and `bind` have been distributed to all the bound parameters. Given that sequences are best avoided (to reduce extra parenthesis), I do not think there is a less verbose way to enumerate the bound parameter list. The followings could also be possible:
+
+ (void) (f)(int x, double& y, const bind (a, &b), bind (&c, d) ) // [3]
+ (void) (f)(int x, double& y) (const bind)(a, &b) (bind)(&c, d) // [4]
+
+But I think enumerating every bound variable separately as in [2] makes the parameter list syntax look the closet to normal C++ syntax even it requires the repetition of `const bind` and `bind` as the types of the bound variables. Therefore, I would prefer [2].
+
+
+
+3 RETURN TYPE AND FUNCTION NAME
+
+I don't know how/if I can simplify the return type and function name passing because I do need the function name as a separate token within the preprocessor to do token concatenation and generate unique names that refer to the function name...
+
+Something like this should be possible (using tuples instead of sequences):
+
+ void, f, ( (int)(x) (double&)(y) (const bind)((a)(&b)) (bind)((&c)(d)) ) // [5]
+ void, (f)( (int)(x) (double&)(y) (const bind)((a)(&b)) (bind)((&c)(d)) ) // [6]
+
+And on C99:
+
+ void, f, (int x, double& y, const bind a, const bind& b, bind& c, bind d) // [7]
+ void, (f)(int x, double& y, const bind a, const bind& b, bind& c, bind d) // [8]
+
+However I don't see how these are simpler than [0] and [2].
+
+Actually, the function name is not really needed as it can be specified just in the END macro (like END_RENAME does) so I could take it out:
+
+ BOOST_LOCAL_FUNCTION( // [12]
+ (void) (int x, double& y, const bind a, const bind& b, bind& c, bind d)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ f(1, 1.23);
+
+If I could remove also the parenthesis around the return type, it would be really cool because the macro parameter would match 100% the usual C++ syntax for function types :)) :
+
+ BOOST_LOCAL_FUNCTION( // [13]
+ void (int x, double& y, const bind a, const bind& b, bind& c, bind d)
+ ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ f(1, 1.23);
+
+But I don't think I can actually do this :( given that void can be any token so I cannot strip it out with the pp... I might be able however to pull the return type outside the macro as in Alex-Steven's syntax:
+
+ void BOOST_LOCAL_FUNCTION(int x, double& y, const bind a, // [14]
+ const bind& b, bind& c, bind d) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END(f)
+ f(1, 1.23);
+
+And regardless of what Alex-Steven did, I could do this by expanding to a dummy variable/expression and then get its type with typeof (but the library will then require typeof to determine the result type even when no bound parameter is used and for a type which is specified by programmes as a type -- that'd be strange):
+
+ void *result_ptr; // Plus append __LINE__...
+ typedef typeof(*result_ptr) result_type;
+ ...
+
+Then it would be better to pull the function name outside the end macro if I could (i.e., if I can program the correct default constructor for the local function_ref... which maybe I can't...):
+
+ void BOOST_LOCAL_FUNCTION(int x, double& y, const bind a, // [15]
+ const bind& b, bind& c, bind d) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END f;
+ f(1, 1.23);
+
+For non C99:
+
+ void BOOST_LOCAL_FUNCTION( (int x) (double& y) (const bind a) // [16]
+ (const bind& b) (bind& c) (bind d) ) {
+ ...
+ } BOOST_LOCAL_FUNCTION_END f;
+ f(1, 1.23);
+
+With respect to the parenthesized syntax, this ad-hoc syntax does not make available to the preprocessor the followings: (1) return type; (2) function name; (3) separation between parameter type and name; But programmers might find this syntax more attractive for local functions...
+
+BTW, can I still specify the function parameters `auto` and `register` with this syntax as I can do with the parenthesized syntax? I don't think I can specify `inline` anymore... (but it's not clear if using `inline` can optimize local functions anyways).
+
+
+
+4 DEFAULT PARAMETER VALUES
+
+Currently local functions support default parameters:
+
+ (void) (f)( (int)(x)(default)(-1) (double)(y)(default)(1.23) ) // [9]
+
+I think this could be simplified to:
+
+ (void) (f)( (int x)(default -1) (double y)(default 1.23) ) // [10]
+
+Note the merging of the parameter type with its name plus the removal of the parenthesis around the default value.
+
+Using C99 variadics:
+
+ (void) (f)(int x, default -1, double y, default 1.23) // [11]
+
+I am not a big fan of this because `default` is separated from its parameter by the comma `,`... but I don't think I can do better than this.
+
+
+
+5 OTHERS
+
+The following points not relevant for local functions but the parenthesized syntax [0] is a general syntax that makes all the elements of a function declaration available for preprocessor metaprogramming. Instead, syntax [1] and [2] do not separate the parameter type from the parameter name. Therefore:
+
+a) I don't think [1] and [2] allow to generate a parameter with the same name but a modified type. For example say I want to add `const` to `int x`, how can I do that unless `int x` is specified as `(int)(x)` or `(int, x)`? (I have to double check, but I don't think local functions need to manipulate parameter types retaining instead the parameter names so I don't think this is an issue for local function.)
+
+b) Having the parameter name as a separate token (which is possible with [0] but not with [1] or [2]) could be useful to generate unique names to handle function overloading. For example, in another library I PP_CAT the function name with the parameter names to generate unique names for overloaded function. As long as the overloaded functions use different parameter names (and not just different parameter types) this mechanism works.
+
+Therefore, *if* there was an interest in defining the parenthesized syntax to be as general as possible so it could be adopted everywhere macros spoil function definitions, [0] is more general because separate the parameter types from the names (at the cost of the extra parenthesis of course).
+

Added: sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/alternative_syntaxes.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,29 @@
+
+Consider the following parenthesized syntax for local functions:
+
+ (void) (f)( (int)(x) (double&)(y) (const bind)((a)(&b)) (bind)((&c)(d)) )
+
+The followings are possible ways to simply this syntax.
+
+DISCLAIMER: I still don't know if any of the following alternative syntaxes really works because I have not tried to implement them yet. This is just a paper excercise to write down possible options before I start looking into their implementation.
+
+
+1) MERGING PARAM TYPE AND NAME (pure C++)
+
+Parameter names can be passed to function types so I can transform `int x` into `int`:
+
+ int x -[make function type]-> void (int x) -[get 1st parm type]-> int
+
+Type should allow me to simplify the parenthesized syntax (*) to:
+
+ (void) (f)( (int x) (double& y) (const bind)((a)(&b)) (bind)((&c)(d)) )
+
+Note that the (unbound) parameter type and name are merged into a single sequence element.
+
+
+2)
+
+
+
+
+

Added: sandbox/local/libs/local/simpler_syntax/params.00.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/params.00.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,115 @@
+
+#include <boost/detail/preprocessor/keyword/is_auto.hpp>
+#include <boost/detail/preprocessor/keyword/is_register.hpp>
+#include <boost/detail/preprocessor/keyword/is_default.hpp>
+#include <boost/detail/preprocessor/keyword/is_const.hpp>
+#include <boost/local/aux_/preprocessor/keyword/is_bind.hpp>
+#include <boost/preprocessor.hpp>
+
+// GRAMMAR
+//
+// param_list:
+// [required_param] [optional_param] [bind_param]
+//
+// required_param:
+// ( [auto | register] param_type param_name )
+//
+// optional_param:
+// required_param param_default
+//
+// param_default:
+// ( default param_default_value )
+//
+// bind_param:
+// ( [const] bind [&] var_name )
+//
+
+void BOOST_LOCAL_FUNCTION_PARAMS(
+ (double& x) (auto int y)(default -1) (register int z)(default -2)
+ (bind a) (bind& b) (const bind c) (const bind& d) ) {
+ y = x;
+} BOOST_LOCAL_FUNCTION_NAME(f)
+
+#define params \
+ (double& x) (auto int y)(default -1) (register int z)(default -2) \
+ (bind a) (bind& b) (const bind c) (const bind& d)
+
+// STRIP //
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_(tokens, stripping_prefix) \
+ BOOST_PP_CAT(stripping_prefix, tokens)
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP(tokens, check_macro, stripping_prefix) \
+ BOOST_PP_IIF(check_macro(tokens), \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_ \
+ , \
+ tokens BOOST_PP_TUPLE_EAT(2) \
+ )(tokens, stripping_prefix)
+
+// STRIP_AUTO //
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_AUTO_auto /* nothing */
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_AUTO(tokens) \
+ BOOST_DETAIL_PP_KEYWORD_STRIP(tokens, BOOST_DETAIL_PP_KEYWORD_IS_AUTO, \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_AUTO_)
+
+// STRIP_REGISTER //
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_REGISTER_register /* nothing */
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_REGISTER(tokens) \
+ BOOST_DETAIL_PP_KEYWORD_STRIP(tokens, BOOST_DETAIL_PP_KEYWORD_IS_REGISTER, \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_REGISTER_)
+
+// STRIP_DEFAULT //
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_DEFAULT_default /* nothing */
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_DEFAULT(tokens) \
+ BOOST_DETAIL_PP_KEYWORD_STRIP(tokens, BOOST_DETAIL_PP_KEYWORD_IS_DEFAULT, \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_DEFAULT_)
+
+// STRIP_CONST //
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_CONST_const /* nothing */
+
+#define BOOST_DETAIL_PP_KEYWORD_STRIP_CONST(tokens) \
+ BOOST_DETAIL_PP_KEYWORD_STRIP(tokens, BOOST_DETAIL_PP_KEYWORD_IS_CONST, \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_CONST_)
+
+// PARAM_TYPE_NAME //
+
+// param_decl is `[auto | register] param_type param_name`
+#define BOOST_DETAIL_PP_SIGN_PARAM_TYPE_NAME(param_decl) \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_AUTO( \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_REGISTER(param_decl))
+
+// PARAM_IS_BOUND //
+
+// param_decl is `[const] bind [&] var_name` for bound params.
+#define BOOST_DETAIL_PP_SIGN_PARAM_IS_BIND(param_decl) \
+ BOOST_LOCAL_AUX_PP_KEYWORD_IS_BIND(param_decl)
+
+#define BOOST_DETAIL_PP_SIGN_PARAM_IS_CONST_BIND(param_decl) \
+ BOOST_PP_BITAND( \
+ BOOST_DETAIL_PP_KEYWORD_IS_CONST(param_decl) \
+ , BOOST_LOCAL_AUX_PP_KEYWORD_IS_BIND( \
+ BOOST_DETAIL_PP_KEYWORD_STRIP_CONST(param_decl)) \
+ )
+
+// TEST //
+
+BOOST_DETAIL_PP_SIGN_PARAM_TYPE_NAME(auto int x)
+BOOST_DETAIL_PP_SIGN_PARAM_TYPE_NAME(double& y)
+
+BOOST_DETAIL_PP_KEYWORD_STRIP_DEFAULT(default -1)
+
+BOOST_DETAIL_PP_SIGN_PARAM_IS_BIND(bind& a)
+BOOST_DETAIL_PP_SIGN_PARAM_IS_CONST_BIND(const bind& a)
+
+#define PRED(s, check_macro, param_decl) check_macro(param_decl)
+
+BOOST_PP_SEQ_FILTER(PRED, BOOST_DETAIL_PP_SIGN_PARAM_IS_BIND, params)
+BOOST_PP_SEQ_FILTER(PRED, BOOST_DETAIL_PP_SIGN_PARAM_IS_CONST_BIND, params)
+

Added: sandbox/local/libs/local/simpler_syntax/va00.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/va00.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,61 @@
+
+#include <boost/variadic_macro_data/VariadicMacroData.hpp>
+#include <boost/preprocessor.hpp>
+
+// I would rename the library to Boost.Preprocessor/Variadics, use the
+// prefix `BOOST_PP_VA` (from the language abbreviation "VA" of `__VA_ARGS__`),
+// and put it into "boost/preprocessor/va/" (with one separate header for each
+// `VA_XXX` macro and a general header "boost/preprocessor/va.hpp" as
+// Boost.Preprocessor does).
+// I would add the followings:
+#define PP_VA_IDENTITY(...) __VA_ARGS__ BOOST_PP_EMPTY
+// I find this usefull but PP does not have for not variadics.
+#define PP_VA_SAME(...) __VA_ARGS__
+#define PP_VA_EAT(...)
+
+
+#define vaps \
+ int x, double& y, const bind a, const bind& b, bind c, bind& d
+
+#define ps \
+ (int x) (double& y) (const bind a) (const bind& b) (bind c) (bind& d)
+
+#define vap1 \
+ int x
+#define p1 \
+ (int x)
+
+/// ARE_PARAMS_VA ///
+
+#define ARE_PARAMS_VA_UNARY_(...) BOOST_PP_NOT(BOOST_PP_IS_UNARY(__VA_ARGS__))
+
+#define ARE_PARAMS_VA(...) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(VMD_DATA_SIZE(__VA_ARGS__), 1), \
+ 1 PP_VA_EAT \
+ , \
+ ARE_PARAMS_VA_UNARY_ \
+ )(__VA_ARGS__)
+
+/////////////////////
+
+
+//>> ARE_PARAMS_VA(vap1) <<
+//>> ARE_PARAMS_VA(vaps) <<
+//>> ARE_PARAMS_VA(p1) <<
+//>> ARE_PARAMS_VA(ps) <<
+
+
+#define HANDLE_PARAMS_VA(...) \
+ BOOST_PP_IIF(ARE_PARAMS_VA(__VA_ARGS__), \
+ VMD_DATA_TO_PP_SEQ \
+ , \
+ PP_VA_SAME \
+ )(__VA_ARGS__)
+
+HANDLE_PARAMS_VA(vaps)
+HANDLE_PARAMS_VA(vap1)
+HANDLE_PARAMS_VA(ps)
+HANDLE_PARAMS_VA(p1)
+
+
+

Added: sandbox/local/libs/local/simpler_syntax/va01.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/simpler_syntax/va01.cpp 2011-02-10 14:54:06 EST (Thu, 10 Feb 2011)
@@ -0,0 +1,110 @@
+
+#include <boost/variadic_macro_data/VariadicMacroData.hpp>
+#include <boost/preprocessor.hpp>
+
+// I would rename the library to Boost.Preprocessor/Variadics, use the
+// prefix `BOOST_PP_VA` (from the language abbreviation "VA" of `__VA_ARGS__`),
+// and put it into "boost/preprocessor/va/" (with one separate header for each
+// `VA_XXX` macro and a general header "boost/preprocessor/va.hpp" as
+// Boost.Preprocessor does).
+// I would add the followings:
+#define PP_VA_IDENTITY(...) __VA_ARGS__ BOOST_PP_EMPTY
+// I find this usefull but PP does not have for not variadics.
+#define PP_VA_SAME(...) __VA_ARGS__
+#define PP_VA_EAT(...)
+// Using variadics macros, it should be possible to support sequences of
+// variable length tuples `(a) (b1, b2) (c1, c2, c3)` (PP only supports
+// sequences of 1-tuple `(a) (b) (c)`). Is this the same of PP_LIST, etc?
+// So I would provide a family of macros similar to PP_SEQ but that work with
+// variable length tuples:
+// PP_VA_SEQ_SIZE, PP_VA_SEQ_ELEM, PP_VA_SEQ_FOR_EACH, etc.
+
+
+// PARENTHESIZED SYNTAX ENHANCMENTS FOR C99
+//
+// C99 VS. ISO C++ PREPROCESSOR
+// On C99 preprocessor, the same macros simply accept multiple syntaxes. The
+// parenthesized syntax as well as the variable length tuple syntax. For
+// example, on C99 the same macros will accept and parse both [1] and [2]
+// below, however on non-C99 preprocessor [2] will generate (nasty)
+// preprocessor errors and only [1] will compile.
+//
+// FUNCTION PARAMETERS
+// Function parameter can be specified as (but no type/name separation :(( ):
+// (void) (f)( (int x) (double& y) (const bind a) ) // [1]
+// and also as (C99 only):
+// (void) (f)(int x, double& y, const bind a) // [2] Usual C++ syntax :))
+//
+// DEFAULT PARAMETER VALUES
+// Empty parameters can be specified as:
+// (void) (f)( (void) ) // [3]
+// and also as (C99 only):
+// (void) (f)() // [4] Usual C++ syntax :))
+//
+// Default parameter values can be specified as:
+// (void) (f)( (int x)(default 0) (double y)(default 1.23) ) // [5]
+// and also as (C99 only):
+// (void) (f)( (int x, default 0) , (double y, default 1.23) ) // [6]
+// and also mix/matching all of the above (C99 only):
+// (void) (f)( (int x)(default 0) , (double y)(default 1.23) ) // [7]
+// (void) (f)( (int x, default 0) (double y, default 1.23) ) // [8]
+// (void) (f)( int x, default 0 , double y, default 1.23 ) // [9]
+// This is kind of confusing... too many options. I can't decide which one is
+// the best because they are all different from usual C++ syntax so I just
+// prefer the parenthesized syntax without C99 features...
+// Boosters, what do you think?
+//
+
+
+
+
+#define vaf \
+ (void) (f)(int x, double& y, const bind a, const bind& b, bind c, bind& d)
+
+#define f \
+ (void) (f)( (int x) (double& y) (const bind a) (const bind& b) (bind c) (bind& d) )
+
+#define vaf1 \
+ (void) (f)(int x)
+#define f1 \
+ (void) (f)(int x)
+
+/// ARE_PARAMS_VA ///
+
+#define ARE_PARAMS_VA_UNARY_(...) BOOST_PP_NOT(BOOST_PP_IS_UNARY(__VA_ARGS__))
+
+#define ARE_PARAMS_VA(...) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(VMD_DATA_SIZE(__VA_ARGS__), 1), \
+ 1 PP_VA_EAT \
+ , \
+ ARE_PARAMS_VA_UNARY_ \
+ )(__VA_ARGS__)
+
+/////////////////////
+
+
+//>> ARE_PARAMS_VA(vap1) <<
+//>> ARE_PARAMS_VA(vaps) <<
+//>> ARE_PARAMS_VA(p1) <<
+//>> ARE_PARAMS_VA(ps) <<
+
+
+#define HANDLE_PARAMS_VA(...) \
+ BOOST_PP_IIF(ARE_PARAMS_VA(__VA_ARGS__), \
+ VMD_DATA_TO_PP_SEQ \
+ , \
+ PP_VA_SAME \
+ )(__VA_ARGS__)
+
+//HANDLE_PARAMS_VA(vaps)
+//HANDLE_PARAMS_VA(vap1)
+//HANDLE_PARAMS_VA(ps)
+//HANDLE_PARAMS_VA(p1)
+
+BOOST_PP_EXPAND(HANDLE_PARAMS BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(vaf)) )
+BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(vaf1))
+BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(f))
+BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(f1))
+
+
+


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