|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75402 - in sandbox/local: . libs/local/doc/html libs/local/doc/html/boost/local/function libs/local/doc/html/boost_local libs/local/example
From: lorcaminiti_at_[hidden]
Date: 2011-11-08 07:22:35
Author: lcaminiti
Date: 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
New Revision: 75402
URL: http://svn.boost.org/trac/boost/changeset/75402
Log:
Commented out compilation of profiling examples because they require Boost.Chrono and Boost.System to be built (so they make it more difficult for users to compile Boost.Local "out of the box" given that the rest of the library is header-only so it does not require a built Boost installed).
Made sure docs build (but no changes).
Text files modified:
sandbox/local/Jamroot.jam | 28 +++---
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_COMPLIANT.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_OVERLOAD_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_NAME.html | 2
sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS.html | 2
sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS_TPL.html | 2
sandbox/local/libs/local/doc/html/BOOST_LOCAL_TYPEOF.html | 2
sandbox/local/libs/local/doc/html/boost/local/function/overload.html | 22 +++---
sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html | 116 +++++++++++--------------------
sandbox/local/libs/local/doc/html/boost_local/Alternatives.html | 26 +-----
sandbox/local/libs/local/doc/html/boost_local/Examples.html | 56 +++++----------
sandbox/local/libs/local/doc/html/boost_local/Getting_Started.html | 4
sandbox/local/libs/local/doc/html/boost_local/Implementation.html | 145 +++++++++++++++++++--------------------
sandbox/local/libs/local/doc/html/boost_local/Tutorial.html | 93 ++++++++++---------------
sandbox/local/libs/local/doc/html/index.html | 75 ++++++++++----------
sandbox/local/libs/local/example/Jamfile.jam | 32 ++++----
26 files changed, 268 insertions(+), 361 deletions(-)
Modified: sandbox/local/Jamroot.jam
==============================================================================
--- sandbox/local/Jamroot.jam (original)
+++ sandbox/local/Jamroot.jam 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -15,19 +15,19 @@
# Boost.Chrono (which needs Boost.System) for GCC (not part of official Boost
# release yet so assumed it was pre-built separately).
-lib libboost_chrono :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so <target-os>linux ;
-lib libboost_chrono :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.a <target-os>cygwin ;
-lib libboost_chrono :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono-vc80-mt-gd-1_47.lib
- <target-os>windows ;
+#lib libboost_chrono :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so <target-os>linux ;
+#lib libboost_chrono :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.a <target-os>cygwin ;
+#lib libboost_chrono :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono-vc80-mt-gd-1_47.lib
+# <target-os>windows ;
# Boost.System as used to build Boost.Chrono.
-lib libboost_system :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so <target-os>linux ;
-lib libboost_system :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_system.a <target-os>cygwin ;
-lib libboost_system :
- : <file>$(BOOST_ROOT)/stage/lib/libboost_system-vc80-mt-gd-1_47.lib
- <target-os>windows ;
+#lib libboost_system :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so <target-os>linux ;
+#lib libboost_system :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_system.a <target-os>cygwin ;
+#lib libboost_system :
+# : <file>$(BOOST_ROOT)/stage/lib/libboost_system-vc80-mt-gd-1_47.lib
+# <target-os>windows ;
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_IDENTITY_TYPE(parenthesized_type)</pre></div>
<div class="refsect1">
-<a name="id927210"></a><h2>Description</h2>
+<a name="id928560"></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_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
<p>For example <code class="computeroutput">BOOST_IDENTITY_TYPE((std::map<int, double>))</code> can be passed as a single macro parameter when instead <code class="computeroutput">std::map<int, double></code> cannot (because <code class="computeroutput">std::map<int, double></code> contains a comma not wrapped by round parenthesis so it will be interpreted as two separate macro parameters by the preprocessor).</p>
<p>In many cases it might be possible to use alternatives to this macro that will make the code more readable. For example, it might be possible to use define a new type <code class="computeroutput">typedef std::map<int, duble> map_type</code> prior to the macro and then pass the newly defined type <code class="computeroutput">map_type</code> which contains no comma as the macro parameter.</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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_IDENTITY_VALUE(parenthesized_value)</pre></div>
<div class="refsect1">
-<a name="id927603"></a><h2>Description</h2>
+<a name="id928828"></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_Topics.html" title="Advanced Topics"> Advanced Topics</a> section).</p>
<p>For example <code class="computeroutput">BOOST_IDENTITY_VALUE((key_sizeof<int, double>::value))</code> can be passed as a single macro parameter when instead <code class="computeroutput">key_sizeof<int, double>::value</code> cannot (because <code class="computeroutput">key_sizeof<int, double>::value</code> contains a comma not wrapped by round parenthesis so it will be interpreted as two separate macro parameters by the preprocessor).</p>
<p>In many cases it might be possible to use alternatives to this macro that will make the code more readable. For example, if the expression type is know (and contains no commas) the type constructor can be used to wrap the expression command within parenthesis <code class="computeroutput">size_type(key_sizeof<int, double>::value)</code>.</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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_BLOCK(bindings)</pre></div>
<div class="refsect1">
-<a name="id921124"></a><h2>Description</h2>
+<a name="id923672"></a><h2>Description</h2>
<p>This macro must be used within a declarative context, it must be followed by the local block body 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 <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_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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_BLOCK_END</pre></div>
<div class="refsect1">
-<a name="id921978"></a><h2>Description</h2>
+<a name="id924325"></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>Note:</strong></span> This macro cannot be used multiple times on the same line because it internally uses the line number <code class="computeroutput">__LINE__</code> to generate unique identifiers.</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>
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_BLOCK_TPL(bindings)</pre></div>
<div class="refsect1">
-<a name="id921904"></a><h2>Description</h2>
+<a name="id924276"></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_COMPLIANT.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_COMPLIANT.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_COMPLIANT.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_CONFIG_COMPLIANT</pre></div>
<div class="refsect1">
-<a name="id922151"></a><h2>Description</h2>
+<a name="id924433"></a><h2>Description</h2>
<p>If programmers leave this configuration macro undefined, its default value is to be left not defined.</p>
<p>If this macro is defined, variadic macros and empty macro parameters are not used by this library. Using variadic macros and empty macro parameters allows this library to provide the <span class="emphasis"><em>variadic macro</em></span> and <span class="emphasis"><em>empty macro</em></span> syntaxes which some programmers might find more readable than the <span class="emphasis"><em>sequencing macro</em></span> syntax (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> section, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code>, <code class="computeroutput"><a class="link" href="BOOST_LOCAL_BLOCK.html" title="Macro BOOST_LOCAL_BLOCK">BOOST_LOCAL_BLOCK</a></code>, and <code class="computeroutput"><a class="link" href="BOOST_LOCAL_EXIT.html" title="Macro BOOST_LOCAL_EXIT">BOOST_LOCAL_EXIT</a></code>). If this configuration macro is defined then only the s
equencing macro syntax is allowed (regardless of whether the compiler supports variadic and empty macros or not).</p>
<p><span class="bold"><strong>Warning:</strong></span> The variadic and empty macro syntaxes are not supported by all C++ compilers so they should be used with care to avoid portability issues (and this configuration macro can be defined to disable them). Variadic macros, are supported by most recent compilers (like MSVC and GCC), they were first introduced by the C99 standard, they are part of the C++11 standard, but they are not part of the C++03 standard. Empty macro parameters are also supported by the C99 standards and they are part of the C++11 standard, but they are not supported by all modern compilers (for example, they are not supported by MSVC).</p>
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_CONFIG_FUNCTION_ARITY_MAX</pre></div>
<div class="refsect1">
-<a name="id922356"></a><h2>Description</h2>
+<a name="id924553"></a><h2>Description</h2>
<p>If programmers leave this configuration macro undefined, its default value is <code class="computeroutput">5</code>.</p>
<p>This only applies to the number of local function parameters and not to the number of bound variables in scope (the limit on the number of bound variables is instead the maximum size allowed for a Boost.Preprocessor sequence).</p>
<p><span class="bold"><strong>Warning:</strong></span> Increasing this number will increase compilation time.</p>
Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_CONFIG_OVERLOAD_MAX</pre></div>
<div class="refsect1">
-<a name="id922464"></a><h2>Description</h2>
+<a name="id924624"></a><h2>Description</h2>
<p>If programmers leave this configuration macro undefined, its default value is <code class="computeroutput">6</code>.</p>
<p>This number must be greater or equal than 2 (because at least two function types are needed to define an overloaded call operator) otherwise the library will generate a compile-time error.</p>
<p><span class="bold"><strong>Warning:</strong></span> Increasing this number will increase compilation time when the header file <code class="computeroutput">"boost/local/function/overload.hpp"</code> is included.</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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_CONFIG_THIS_PARAM_NAME</pre></div>
<div class="refsect1">
-<a name="id922577"></a><h2>Description</h2>
+<a name="id924697"></a><h2>Description</h2>
<p>If programmers leave this configuration macro undefined, the default symbol used is <code class="computeroutput">this_</code> (this default symbol follows Boost's conventions to postfix with an underscore symbols that refer to C++ keywords -- the <code class="computeroutput">this</code> keyword in this case).</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/Tutorial.html" title="Tutorial">Tutorial</a> section, <a class="link" href="boost_local/Getting_Started.html" title="Getting Started"> Getting Started</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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_EXIT(binding_list)</pre></div>
<div class="refsect1">
-<a name="id922735"></a><h2>Description</h2>
+<a name="id924796"></a><h2>Description</h2>
<p>This macro must be used within a declarative context, it must be followed by the local exit body 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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_EXIT_END</pre></div>
<div class="refsect1">
-<a name="id923592"></a><h2>Description</h2>
+<a name="id925381"></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>Note:</strong></span> This macro cannot be used multiple times on the same line because it internally uses the line number <code class="computeroutput">__LINE__</code> to generate unique identifiers.</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>
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_EXIT_TPL(binding_list)</pre></div>
<div class="refsect1">
-<a name="id923518"></a><h2>Description</h2>
+<a name="id925332"></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_NAME.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_NAME.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_NAME.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_FUNCTION_NAME(name)</pre></div>
<div class="refsect1">
-<a name="id924850"></a><h2>Description</h2>
+<a name="id926238"></a><h2>Description</h2>
<p>This macro must follow the local function body code block <code class="computeroutput">{ ... }</code> as shown in the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code> documentation.</p>
<p>The local function name can be prefixed by the "keyword" <code class="computeroutput">inline</code> (see the <a class="link" href="boost_local/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section): </p>
<pre class="programlisting"> <span class="special">...</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="keyword">inline</span> <span class="identifier">name</span><span class="special">)</span>
Modified: sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_FUNCTION_PARAMS(parameters)</pre></div>
<div class="refsect1">
-<a name="id923758"></a><h2>Description</h2>
+<a name="id925487"></a><h2>Description</h2>
<p>This macro must be used within a declarative context, it must follow the local function result type, it must be followed by the local function body code and then by the <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code> macro (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a> and <a class="link" href="boost_local/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</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_PARAMS_TPL.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS_TPL.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_FUNCTION_PARAMS_TPL.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_FUNCTION_PARAMS_TPL(parameters)</pre></div>
<div class="refsect1">
-<a name="id924775"></a><h2>Description</h2>
+<a name="id926189"></a><h2>Description</h2>
<p><span class="bold"><strong>See:</strong></span> <code class="computeroutput"><a class="link" href="BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code>, <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_TYPEOF.html
==============================================================================
--- sandbox/local/libs/local/doc/html/BOOST_LOCAL_TYPEOF.html (original)
+++ sandbox/local/libs/local/doc/html/BOOST_LOCAL_TYPEOF.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -33,7 +33,7 @@
</span>BOOST_LOCAL_TYPEOF(bound_variable_name)</pre></div>
<div class="refsect1">
-<a name="id926888"></a><h2>Description</h2>
+<a name="id928343"></a><h2>Description</h2>
<p>The type is fully qualified in that it contains the extra constant and reference qualifiers when they are specified for binding by constant and by reference. For example, if a variable named <code class="computeroutput">t</code> of type <code class="computeroutput">T</code> is: </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>Bound by value using <code class="computeroutput">bind t</code> then <code class="computeroutput">BOOST_LOCAL_TYPEOF(t)</code> is <code class="computeroutput">T</code>. </p></li>
Modified: sandbox/local/libs/local/doc/html/boost/local/function/overload.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost/local/function/overload.html (original)
+++ sandbox/local/libs/local/doc/html/boost/local/function/overload.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -35,44 +35,44 @@
<span class="keyword">class</span> <a class="link" href="overload.html" title="Class template overload">overload</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="overload.html#boost.local.function.overloadconstruct-copy-destruct">construct/copy/destruct</a></span>
- <a class="link" href="overload.html#id436232-bb"><span class="identifier">overload</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F2</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>
+ <a class="link" href="overload.html#id456946-bb"><span class="identifier">overload</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F2</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="comment">// <a class="link" href="overload.html#id436150-bb">public member functions</a></span>
+ <span class="comment">// <a class="link" href="overload.html#id456892-bb">public member functions</a></span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">result_type</span>
- <a class="link" href="overload.html#id436154-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+ <a class="link" href="overload.html#id456894-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">result_type</span>
- <a class="link" href="overload.html#id436193-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+ <a class="link" href="overload.html#id456920-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
-<a name="id926038"></a><h2>Description</h2>
+<a name="id927750"></a><h2>Description</h2>
<p>This functor aggregates together calls to functions of all the specified function types <code class="computeroutput">F1</code>, <code class="computeroutput">F2</code>, etc. Each function type must be specified following the Boost.Function preferred syntax: </p>
<pre class="programlisting"> <span class="identifier">ResultType</span> <span class="special">(</span><span class="identifier">ArgumentType1</span><span class="special">,</span> <span class="identifier">ArgumgnetType2</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span>
</pre>
<p>The maximum number of overloaded function types is specified by the <code class="computeroutput"><a class="link" href="../../../BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_LOCAL_CONFIG_OVERLOAD_MAX">BOOST_LOCAL_CONFIG_OVERLOAD_MAX</a></code> configuration macro. The maximum number of function parameters for each of the specified function type is specified by the <code class="computeroutput"><a class="link" href="../../../BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_LOCAL_CONFIG_OVERLOAD_MAX">BOOST_LOCAL_CONFIG_OVERLOAD_MAX</a></code> configuration macro.</p>
<p><span class="bold"><strong>See:</strong></span> <a class="link" href="../../../boost_local/Advanced_Topics.html" title="Advanced Topics"> Advanced Topics</a> section, <code class="computeroutput"><a class="link" href="../../../BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_LOCAL_CONFIG_OVERLOAD_MAX">BOOST_LOCAL_CONFIG_OVERLOAD_MAX</a></code>, <code class="computeroutput"><a class="link" href="../../../BOOST_LOCAL_CONFIG_OVERLOAD_MAX.html" title="Macro BOOST_LOCAL_CONFIG_OVERLOAD_MAX">BOOST_LOCAL_CONFIG_OVERLOAD_MAX</a></code>, Boost.Function. </p>
<div class="refsect2">
-<a name="id926182"></a><h3>
+<a name="id927845"></a><h3>
<a name="boost.local.function.overloadconstruct-copy-destruct"></a><code class="computeroutput">overload</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
-<pre class="literallayout"><a name="id436232-bb"></a><span class="identifier">overload</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F2</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></pre>Construct the overloading functor. <p>Any functor that can be converted to a <code class="computeroutput">boost::function</code> funcotr can be specified (local functions, functio
n pointers, other functors, etc). </p>
+<pre class="literallayout"><a name="id456946-bb"></a><span class="identifier">overload</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">F2</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></pre>Construct the overloading functor. <p>Any functor that can be converted to a <code class="computeroutput">boost::function</code> funcotr can be specified (local functions, functio
n pointers, other functors, etc). </p>
</li></ol></div>
</div>
<div class="refsect2">
-<a name="id926357"></a><h3>
-<a name="id436150-bb"></a><code class="computeroutput">overload</code> public member functions</h3>
+<a name="id927970"></a><h3>
+<a name="id456892-bb"></a><code class="computeroutput">overload</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">result_type</span>
-<a name="id436154-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+<a name="id456894-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F1</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Call operator matching the signature of the function type specified as first. <p>This will in turn invoke the call operator of the first functor that was passed to the constructor. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">result_type</span>
-<a name="id436193-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
+<a name="id456920-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg1_type</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">F2</span> <span class="special">></span><span class="special">::</span><span class="identifier">arg2_type</span><span class="special">,</span> <span class="special">...</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Call operator matching the signature of the function type specified as second. <p>This will in turn invoke the call operator of the second functor that was passed to the constructor. </p>
</li>
</ol></div>
Modified: sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Advanced_Topics.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -86,7 +86,7 @@
<p>
In addition, local function parameter types cannot start with non-alphanumeric
symbols (alphanumeric symbols are <code class="computeroutput"><span class="identifier">A</span><span class="special">-</span><span class="identifier">Z</span></code>, <code class="computeroutput"><span class="identifier">a</span><span class="special">-</span><span class="identifier">z</span></code>,
- and <code class="computeroutput"><span class="number">0</span><span class="special">-</span><span class="number">9</span></code>). <sup>[<a name="id882777" href="#ftn.id882777" class="footnote">19</a>]</sup> The library will generate (cryptic) preprocessor errors if a
+ and <code class="computeroutput"><span class="number">0</span><span class="special">-</span><span class="number">9</span></code>). <sup>[<a name="boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f0" href="#ftn.boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f0" class="footnote">19</a>]</sup> The library will generate (cryptic) preprocessor errors if a
parameter type starts with a non-alphanumeric symbol.
</p>
<p>
@@ -113,7 +113,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>&</span> <span class="identifier">m</span><span class="special">,</span> <span class="comment">// (1) Error.</span>
@@ -128,7 +127,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>&</span> <span class="identifier">m</span><span class="special">)</span> <span class="comment">// (1) Error.</span>
@@ -175,7 +173,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>&))</span> <span class="identifier">m</span><span class="special">,</span> <span class="comment">// OK.</span>
@@ -187,7 +184,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">(</span><code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code><span class="special">((</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>&))</span> <span class="identifier">m</span><span class="special">)</span> <span class="comment">// OK.</span>
@@ -227,7 +223,7 @@
<li class="listitem">
Parenthesis to wrap the type expression (and therefore any commas <code class="computeroutput"><span class="special">,</span></code> that it contains) passed as parameter
to the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
- macro. <sup>[<a name="id884228" href="#ftn.id884228" class="footnote">20</a>]</sup>
+ macro. <sup>[<a name="boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f1" href="#ftn.boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f1" class="footnote">20</a>]</sup>
</li>
</ol></div>
<div class="note"><table border="0" summary="Note">
@@ -264,7 +260,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">></span> <span class="identifier">map_type</span><span class="special">;</span>
<span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
@@ -277,7 +272,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">></span> <span class="identifier">map_type</span><span class="special">;</span>
<span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
@@ -320,7 +314,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -333,7 +326,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -380,7 +372,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -393,7 +384,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -438,7 +428,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -452,7 +441,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">...</span> <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code><span class="special">(</span>
<span class="special">...</span>
@@ -513,7 +501,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -556,7 +543,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">utility</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -576,7 +562,7 @@
<span class="comment">// Identity macros handle commas.</span>
<span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>))&</span> <span class="identifier">m</span><span class="special">)</span>
<span class="comment">// Also, identity macros handle leading symbols.</span>
- <span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((::</span><span class="identifier">sign_t</span><span class="special">))</span> <span class="identifier">sign</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">BOOST_IDENTITY_TYPE</span><span class="special">((::</span><span class="identifier">sign_t</span><span class="special">))</span> <span class="identifier">sign</span><span class="special">)(</span><span class="keyword">default</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span>
<span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_t</span><span class="special">&</span> <span class="identifier">factor</span><span class="special">)(</span><span class="keyword">default</span> <span class="comment">// Or use `BOOST_IDENTITY_VALUE`.</span>
<span class="special">(</span><span class="identifier">key_size</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">>::</span><span class="identifier">value</span><span class="special">))</span>
<span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">separator</span><span class="special">)(</span><span class="keyword">default</span> <span class="identifier">cat</span><span class="special">(</span><span class="string">":"</span><span class="special">,</span> <span class="string">" "</span><span class="special">))</span> <span class="special">)</span> <span class="special">{</span>
@@ -647,7 +633,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -662,7 +647,7 @@
<span class="special">{</span>
<span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
-
+
<span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">1</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">2</span><span class="special">,</span>
<span class="identifier">bind</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">i</span> <span class="special">*</span> <span class="identifier">y</span><span class="special">;</span>
@@ -676,7 +661,7 @@
<span class="identifier">doit1</span><span class="special">(</span><span class="identifier">linear</span><span class="special">);</span>
<span class="identifier">doit0</span><span class="special">(</span><span class="identifier">linear</span><span class="special">);</span>
<span class="special">}</span>
-
+
<span class="keyword">if</span> <span class="special">(</span><span class="keyword">false</span><span class="special">)</span> <span class="special">{</span>
<span class="identifier">l2</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">);</span> <span class="comment">// This wouuld raise run-time error because invalid reference.</span>
<span class="special">}</span>
@@ -689,7 +674,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -704,7 +688,7 @@
<span class="special">{</span>
<span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
-
+
<span class="keyword">int</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">1</span><span class="special">)</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">2</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">bind</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">i</span> <span class="special">*</span> <span class="identifier">y</span><span class="special">;</span>
@@ -718,7 +702,7 @@
<span class="identifier">doit1</span><span class="special">(</span><span class="identifier">linear</span><span class="special">);</span>
<span class="identifier">doit0</span><span class="special">(</span><span class="identifier">linear</span><span class="special">);</span>
<span class="special">}</span>
-
+
<span class="keyword">if</span> <span class="special">(</span><span class="keyword">false</span><span class="special">)</span> <span class="special">{</span>
<span class="identifier">l2</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">);</span> <span class="comment">// This would raise run-time error because invalid reference.</span>
<span class="special">}</span>
@@ -758,7 +742,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -793,7 +776,7 @@
<span class="keyword">for</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="special">{</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="special">*</span><span class="identifier">i</span><span class="special">;</span> <span class="special">}</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -802,7 +785,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -837,7 +819,7 @@
<span class="keyword">for</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="special">{</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="special">*</span><span class="identifier">i</span><span class="special">;</span> <span class="special">}</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -906,7 +888,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -963,7 +944,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1047,7 +1027,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1107,7 +1086,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1222,7 +1200,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1282,7 +1259,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1370,7 +1346,7 @@
to their equivalent implementation that uses local functors (see the <a class="link" href="Alternatives.html" title="Appendix: Alternatives">Alternatives</a> section). However,
inlined local functions have the limitation that they cannot be assigned
to other functors (like <code class="computeroutput">boost::function</code>)
- and they cannot be passed as template parameters. <sup>[<a name="id904920" href="#ftn.id904920" class="footnote">21</a>]</sup> On C++11
+ and they cannot be passed as template parameters. <sup>[<a name="boost_local.Advanced_Topics.inlining_local_functions.f0" href="#ftn.boost_local.Advanced_Topics.inlining_local_functions.f0" class="footnote">21</a>]</sup> On C++11
compilers, <code class="computeroutput"><span class="keyword">inline</span></code> has no effect
because this library will automatically generate code that uses C++11
specific features to inline the local function calls whenever possible even
@@ -1420,7 +1396,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -1460,7 +1435,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -1542,7 +1516,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1566,7 +1539,7 @@
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">recursion</span><span class="special">)</span> <span class="identifier">this_</span><span class="special">-></span><span class="identifier">output</span> <span class="special"><<</span> <span class="identifier">result</span> <span class="special"><<</span> <span class="identifier">separator</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">recursive</span> <span class="identifier">factorial</span><span class="special">)</span> <span class="comment">// Specified recursive.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">nums</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">factorial</span><span class="special">);</span>
<span class="special">}</span>
<span class="special">};</span>
@@ -1587,7 +1560,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1611,7 +1583,7 @@
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">recursion</span><span class="special">)</span> <span class="identifier">this_</span><span class="special">-></span><span class="identifier">output</span> <span class="special"><<</span> <span class="identifier">result</span> <span class="special"><<</span> <span class="identifier">separator</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">recursive</span> <span class="identifier">factorial</span><span class="special">)</span> <span class="comment">// Specified recursive.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">nums</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">nums</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">factorial</span><span class="special">);</span>
<span class="special">}</span>
<span class="special">};</span>
@@ -1635,7 +1607,7 @@
<p>
Compilers have not been observed to be able to inline recursive local function
calls (not even when the recursive local function is also declared inlined).
- <sup>[<a name="id909349" href="#ftn.id909349" class="footnote">22</a>]</sup>
+ <sup>[<a name="boost_local.Advanced_Topics.recursive_local_functions.f0" href="#ftn.boost_local.Advanced_Topics.recursive_local_functions.f0" class="footnote">22</a>]</sup>
</p>
</div>
<div class="section">
@@ -1677,7 +1649,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">/</span><span class="identifier">overload</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// Include header for overloading.</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1703,7 +1674,7 @@
<span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">name</span><span class="special">,</span> <span class="keyword">default</span> <span class="string">" (double)"</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">end</span><span class="special">)</span> <span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">item</span> <span class="special"><<</span> <span class="identifier">name</span> <span class="special"><<</span> <span class="identifier">end</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">print_double</span><span class="special">)</span>
-
+
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">local</span><span class="special">::</span><span class="identifier">function</span><span class="special">::</span><span class="identifier">overload</span><span class="special"><</span>
<span class="keyword">void</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&)</span>
<span class="special">,</span> <span class="keyword">void</span> <span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&)</span> <span class="comment">// Overload 1st param type.</span>
@@ -1714,13 +1685,13 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span> <span class="identifier">s</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="identifier">s</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="string">"ab"</span><span class="special">;</span> <span class="identifier">s</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="string">"cd"</span><span class="special">;</span> <span class="identifier">s</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span> <span class="string">"ef"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">print</span><span class="special">);</span> <span class="comment">// Call `print_string` 1-param.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">d</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">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.2</span><span class="special">;</span> <span class="identifier">d</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">3.4</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">print</span><span class="special">);</span> <span class="comment">// Call `print_double` 1-param.</span>
<span class="identifier">print</span><span class="special">(-</span><span class="number">1.234</span><span class="special">,</span> <span class="string">" (real)"</span><span class="special">);</span> <span class="comment">// Call `print_double` 2-params.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">print</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Call `print_add`.</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
@@ -1731,7 +1702,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">/</span><span class="identifier">overload</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// Include header for overloading.</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1757,7 +1727,7 @@
<span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">name</span><span class="special">)(</span><span class="keyword">default</span> <span class="string">" (double)"</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">end</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">item</span> <span class="special"><<</span> <span class="identifier">name</span> <span class="special"><<</span> <span class="identifier">end</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">print_double</span><span class="special">)</span>
-
+
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">local</span><span class="special">::</span><span class="identifier">function</span><span class="special">::</span><span class="identifier">overload</span><span class="special"><</span>
<span class="keyword">void</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&)</span>
<span class="special">,</span> <span class="keyword">void</span> <span class="special">(</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&)</span> <span class="comment">// Overload 1st param type.</span>
@@ -1768,13 +1738,13 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span> <span class="identifier">s</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="identifier">s</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="string">"ab"</span><span class="special">;</span> <span class="identifier">s</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="string">"cd"</span><span class="special">;</span> <span class="identifier">s</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">=</span> <span class="string">"ef"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">print</span><span class="special">);</span> <span class="comment">// Call `print_string` 1-param.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">d</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">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.2</span><span class="special">;</span> <span class="identifier">d</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">3.4</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">print</span><span class="special">);</span> <span class="comment">// Call `print_double` 1-param.</span>
<span class="identifier">print</span><span class="special">(-</span><span class="number">1.234</span><span class="special">,</span> <span class="string">" (real)"</span><span class="special">);</span> <span class="comment">// Call `print_double` 2-params.</span>
-
+
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">print</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Call `print_add`.</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
@@ -1818,7 +1788,7 @@
functor can be constructed from any function type that can be converted to
a <code class="computeroutput">boost::function</code>
type (i.e., local functions but also function pointers and other function
- objects). <sup>[<a name="id913906" href="#ftn.id913906" class="footnote">23</a>]</sup> The <code class="computeroutput"><a class="link" href="../boost/local/function/overload.html" title="Class template overload">boost::local::function::overload</a></code>
+ objects). <sup>[<a name="boost_local.Advanced_Topics.overloading_local_functions.f0" href="#ftn.boost_local.Advanced_Topics.overloading_local_functions.f0" class="footnote">23</a>]</sup> The <code class="computeroutput"><a class="link" href="../boost/local/function/overload.html" title="Class template overload">boost::local::function::overload</a></code>
functor provides overloaded call operators <code class="computeroutput"><span class="keyword">operator</span><span class="special">()</span></code> that match the signatures of all the specified
function types.
</p>
@@ -1862,7 +1832,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1884,7 +1853,7 @@
<span class="identifier">x</span><span class="special">--;</span>
<span class="identifier">m</span><span class="special">();</span> <span class="comment">// Nested local function call.</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
-
+
<span class="comment">// Local functions, blocks and exits nested into each other.</span>
<span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span>
@@ -1910,7 +1879,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1932,7 +1900,7 @@
<span class="identifier">x</span><span class="special">--;</span>
<span class="identifier">m</span><span class="special">();</span> <span class="comment">// Nested local function call.</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">l</span><span class="special">)</span>
-
+
<span class="comment">// Local functions, blocks and exits nested into each other.</span>
<span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
@@ -1942,7 +1910,7 @@
<span class="identifier">BOOST_LOCAL_BLOCK</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
<span class="identifier">assert</span><span class="special">(</span><span class="identifier">x</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
-
+
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"n: "</span> <span class="special"><<</span> <span class="identifier">x</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
@@ -2009,7 +1977,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -2050,7 +2017,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -2100,7 +2066,7 @@
<p>
Local function parameters support the storage classifiers as usual in C++03.
The <code class="computeroutput"><span class="keyword">auto</span></code> storage classifier
- is specified as: <sup>[<a name="id918540" href="#ftn.id918540" class="footnote">24</a>]</sup>
+ is specified as: <sup>[<a name="boost_local.Advanced_Topics.storage_classifiers___auto__and__register__.f0" href="#ftn.boost_local.Advanced_Topics.storage_classifiers___auto__and__register__.f0" class="footnote">24</a>]</sup>
</p>
<pre class="programlisting"><span class="keyword">auto</span> <span class="emphasis"><em>parameter-type parameter-name</em></span>
</pre>
@@ -2134,7 +2100,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -2154,7 +2119,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -2333,7 +2297,7 @@
<td>
<p>
This is not supported because local functions are not member functions.
- <sup>[<a name="id919849" href="#ftn.id919849" class="footnote">a</a>]</sup>
+ <sup>[<a name="boost_local.Advanced_Topics.limitations__operators__etc_.f0" href="#ftn.boost_local.Advanced_Topics.limitations__operators__etc_.f0" class="footnote">a</a>]</sup>
</p>
</td>
</tr>
@@ -2432,7 +2396,7 @@
</td>
</tr>
</tbody>
-<tbody class="footnotes"><tr><td colspan="3"><div class="footnote"><p><sup>[<a id="ftn.id919849" href="#id919849" class="para">a</a>] </sup>
+<tbody class="footnotes"><tr><td colspan="3"><div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.limitations__operators__etc_.f0" href="#boost_local.Advanced_Topics.limitations__operators__etc_.f0" class="para">a</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> It would be possible
to make a local function class inherit from another local function
class. However, this "inheritance" feature is not implemented
@@ -2442,13 +2406,13 @@
to dynamic binding or base function call.
</p></div></td></tr></tbody>
</table></div>
-<a name="boost_local.Advanced_Topics.limitations__operators__etc_.operators"></a><h6>
-<a name="boost_local.Advanced_Topics.limitations__operators__etc_.operators-heading"></a>
- <a class="link" href="Advanced_Topics.html#boost_local.Advanced_Topics.limitations__operators__etc_.operators">Operators</a>
+<h6>
+<a name="boost_local.Advanced_Topics.limitations__operators__etc_.h0"></a>
+ <span><a name="boost_local.Advanced_Topics.limitations__operators__etc_.operators"></a></span><a class="link" href="Advanced_Topics.html#boost_local.Advanced_Topics.limitations__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="id920197" href="#ftn.id920197" class="footnote">25</a>]</sup>
+ will generate a compile-time error. <sup>[<a name="boost_local.Advanced_Topics.limitations__operators__etc_.f1" href="#ftn.boost_local.Advanced_Topics.limitations__operators__etc_.f1" class="footnote">25</a>]</sup>
</p>
<p>
For example, the following code will <span class="bold"><strong>not</strong></span>
@@ -2468,9 +2432,9 @@
<span class="special">...</span>
<span class="special">}</span>
</pre>
-<a name="boost_local.Advanced_Topics.limitations__operators__etc_.goto"></a><h6>
-<a name="boost_local.Advanced_Topics.limitations__operators__etc_.goto-heading"></a>
- <a class="link" href="Advanced_Topics.html#boost_local.Advanced_Topics.limitations__operators__etc_.goto">Goto</a>
+<h6>
+<a name="boost_local.Advanced_Topics.limitations__operators__etc_.h1"></a>
+ <span><a name="boost_local.Advanced_Topics.limitations__operators__etc_.goto"></a></span><a class="link" href="Advanced_Topics.html#boost_local.Advanced_Topics.limitations__operators__etc_.goto">Goto</a>
</h6>
<p>
It is not possible to jump with a <code class="computeroutput"><span class="keyword">goto</span></code>
@@ -2500,21 +2464,21 @@
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id882777" href="#id882777" class="para">19</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f0" href="#boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f0" class="para">19</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> This limitation derives from
the fact that <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS">BOOST_LOCAL_FUNCTION_PARAMS</a></code>
uses preprocessor token concatenation to inspect the parameter type token
to see if the token is a parameter or a bound variable. The C++ preprocessor
does not allow to concatenate non-alphanumeric tokens.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id884228" href="#id884228" class="para">20</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f1" href="#boost_local.Advanced_Topics.commas_and_symbols_in_macro_parameters.f1" class="para">20</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> Using variadic macros,
this extra set of parenthesis could be eliminated requiring only the
parenthesis to invoke the <code class="computeroutput"><a class="link" href="../BOOST_IDENTITY_TYPE.html" title="Macro BOOST_IDENTITY_TYPE">BOOST_IDENTITY_TYPE</a></code>
macro. However, this feature is currently not implemented and the double
parenthesis are always needed when invoking this macro.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id904920" href="#id904920" class="para">21</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.inlining_local_functions.f0" href="#boost_local.Advanced_Topics.inlining_local_functions.f0" class="para">21</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> This library uses an indirect
function call via a function pointer in order to pass the local function
as a template parameter (see the <a class="link" href="Implementation.html" title="Appendix: Implementation">Implementation</a>
@@ -2530,12 +2494,12 @@
be inlined on C++11
compilers (even when the local function is not declared inlined).
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id909349" href="#id909349" class="para">22</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.recursive_local_functions.f0" href="#boost_local.Advanced_Topics.recursive_local_functions.f0" class="para">22</a>] </sup>
<span class="bold"><strong>Ratinale.</strong></span> Local functions are not declared
recursive by default because recursion seems to always prevent the possibility
for inlining optimization.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id913906" href="#id913906" class="para">23</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.overloading_local_functions.f0" href="#boost_local.Advanced_Topics.overloading_local_functions.f0" class="para">23</a>] </sup>
The <code class="computeroutput"><a class="link" href="../boost/local/function/overload.html" title="Class template overload">boost::local::function::overload</a></code>
functor can aggregate any functor and it is not at all specific to local
functions. Therefore, it might be preferable to move <code class="computeroutput"><a class="link" href="../boost/local/function/overload.html" title="Class template overload">boost::local::function::overload</a></code>
@@ -2543,7 +2507,7 @@
to Boost.Function
and to rename it as <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special">::</span><span class="identifier">overload</span></code>.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id918540" href="#id918540" class="para">24</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.storage_classifiers___auto__and__register__.f0" href="#boost_local.Advanced_Topics.storage_classifiers___auto__and__register__.f0" class="para">24</a>] </sup>
The <code class="computeroutput"><span class="keyword">auto</span></code> storage classifier
is part of the C++03
standard and therefore supported by this library. However, the meaning
@@ -2553,7 +2517,7 @@
classifier with the usual care in order to avoid writing C++03
code that might not work on C++11.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id920197" href="#id920197" class="para">25</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Advanced_Topics.limitations__operators__etc_.f1" href="#boost_local.Advanced_Topics.limitations__operators__etc_.f1" class="para">25</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) and operators cannot be used as local variable
Modified: sandbox/local/libs/local/doc/html/boost_local/Alternatives.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Alternatives.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Alternatives.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -346,9 +346,9 @@
</tr>
</tbody>
</table></div>
-<a name="boost_local.Alternatives.local_functions.comparison_with__ulink_url__http___en_wikipedia_org_wiki_c_2b_2b0x_lambda_functions_and_expressions__c__11_lambda__ulink__functions"></a><h6>
-<a name="boost_local.Alternatives.local_functions.comparison_with__ulink_url__http___en_wikipedia_org_wiki_c_2b_2b0x_lambda_functions_and_expressions__c__11_lambda__ulink__functions-heading"></a>
- <a class="link" href="Alternatives.html#boost_local.Alternatives.local_functions.comparison_with__ulink_url__http___en_wikipedia_org_wiki_c_2b_2b0x_lambda_functions_and_expressions__c__11_lambda__ulink__functions">Comparison
+<h6>
+<a name="boost_local.Alternatives.local_functions.h0"></a>
+ <span><a name="boost_local.Alternatives.local_functions.comparison_with__ulink_url__http___en_wikipedia_org_wiki_c_2b_2b0x_lambda_functions_and_expressions__c__11_lambda__ulink__functions"></a></span><a class="link" href="Alternatives.html#boost_local.Alternatives.local_functions.comparison_with__ulink_url__http___en_wikipedia_org_wiki_c_2b_2b0x_lambda_functions_and_expressions__c__11_lambda__ulink__functions">Comparison
with <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
Lambda</a> Functions</a>
</h6>
@@ -414,7 +414,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">noncopyable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -441,7 +440,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">noncopyable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -468,7 +466,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">noncopyable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -528,7 +525,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -557,7 +553,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -586,7 +581,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -615,9 +609,9 @@
</td>
</tr></tbody>
</table></div>
-<a name="boost_local.Alternatives.local_functions.examples"></a><h6>
-<a name="boost_local.Alternatives.local_functions.examples-heading"></a>
- <a class="link" href="Alternatives.html#boost_local.Alternatives.local_functions.examples">Examples</a>
+<h6>
+<a name="boost_local.Alternatives.local_functions.h1"></a>
+ <span><a name="boost_local.Alternatives.local_functions.examples"></a></span><a class="link" href="Alternatives.html#boost_local.Alternatives.local_functions.examples">Examples</a>
</h6>
<p>
The same example is rewritten here for all the different alternatives to
@@ -646,7 +640,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -680,7 +673,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -718,7 +710,6 @@
Or using C++ local functors:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -759,7 +750,6 @@
locally so they are not a real alternative implementation of local functions):
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -804,7 +794,6 @@
standard):
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -837,7 +826,6 @@
functions:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">lambda</span><span class="special">/</span><span class="identifier">lambda</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -872,7 +860,6 @@
Or using Boost.Phoenix:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1020,7 +1007,6 @@
<p>
The following commands were executed from the library example directory
to measure compile-time, binary size, and run-time respectively:
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">></span> <span class="identifier">python</span> <span class="identifier">chrono</span><span class="special">.</span><span class="identifier">py</span> <span class="identifier">bjam</span> <span class="special">{</span><span class="identifier">release</span><span class="special">|</span><span class="identifier">debug</span><span class="special">}</span> <span class="special"><</span><span class="identifier">PROGRAM</span><span class="special">></span> <span class="preprocessor"># compile</span><span class="special">-</span><span class="identifier">time</span>
<span class="special">></span> <span class="identifier">size</span> <span class="special"><</span><span class="identifier">PROGRAM</span><span class="special">></span> <span class="preprocessor"># binary</span> <span class="identifier">size</span> <span class="special">(</span><span class="identifier">Linux</span> <span class="keyword">and</span> <span class="identifier">Gygwin</span><span class="special">)</span>
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -77,7 +77,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foreach</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -181,7 +180,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foreach</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -322,7 +320,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -337,7 +334,7 @@
BOOST_LOCAL_EXIT(const bind& error) { // Sane as D's `scope(success)`.
if (!error) std::cout << "success" << std::endl;
} BOOST_LOCAL_EXIT_END
-
+
BOOST_LOCAL_EXIT(const bind& error) { // Same as D's `scope(failure)`.
if (error) std::cout << "failure" << std::endl;
} BOOST_LOCAL_EXIT_END
@@ -354,7 +351,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -369,11 +365,11 @@
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Sane as D's `scope(success)`.</span>
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"success"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Same as D's `scope(failure)`.</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"failure"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="keyword">return</span> <span class="identifier">error</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">;</span> <span class="comment">// Must set error.</span>
<span class="special">}</span>
@@ -410,7 +406,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -426,11 +421,11 @@
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Same as D's `scope(success)`.</span>
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"success"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Same as D's `scope(failure)`.</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"failure"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="identifier">error</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span> <span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span><span class="special">(</span><span class="string">"some error"</span><span class="special">);</span> <span class="comment">// Must set error.</span>
<span class="special">}</span>
@@ -450,7 +445,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -466,11 +460,11 @@
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Same as D's `scope(success)`.</span>
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"success"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">error</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Same as D's `scope(failure)`.</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">error</span><span class="special">)</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"failure"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_EXIT_END</span>
-
+
<span class="identifier">error</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span> <span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span><span class="special">(</span><span class="string">"some error"</span><span class="special">);</span> <span class="comment">// Must set error.</span>
<span class="special">}</span>
@@ -522,7 +516,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">list</span><span class="special">></span>
@@ -550,7 +543,7 @@
<span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">min_salary</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">u_limit</span><span class="special">)</span> <span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">salary</span><span class="special">()</span> <span class="special">>=</span> <span class="identifier">min_salary</span> <span class="special">&&</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">salary</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">u_limit</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">between</span><span class="special">)</span>
-
+
<span class="comment">// Pass local function to an STL algorithm as a template paramter (this</span>
<span class="comment">// cannot be done with plain member funcitons of local classes).</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">employee</span><span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">find_if</span><span class="special">(</span>
@@ -565,7 +558,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">list</span><span class="special">></span>
@@ -593,7 +585,7 @@
<span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">min_salary</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">u_limit</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">salary</span><span class="special">()</span> <span class="special">>=</span> <span class="identifier">min_salary</span> <span class="special">&&</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">salary</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">u_limit</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">between</span><span class="special">)</span>
-
+
<span class="comment">// Pass local function to an STL algorithm as a template paramter (this</span>
<span class="comment">// cannot be done with plain member funcitons of local classes).</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">employee</span><span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">find_if</span><span class="special">(</span>
@@ -642,7 +634,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -679,11 +670,11 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">i</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">0</span><span class="special">);</span>
<span class="identifier">i</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
-
+
<span class="identifier">a</span> <span class="identifier">an</span><span class="special">(</span><span class="identifier">n</span><span class="special">);</span>
<span class="identifier">an</span><span class="special">.</span><span class="identifier">change_sign_all</span><span class="special">(</span><span class="identifier">i</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">an</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -692,7 +683,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -729,11 +719,11 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">i</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">0</span><span class="special">);</span>
<span class="identifier">i</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
-
+
<span class="identifier">a</span> <span class="identifier">an</span><span class="special">(</span><span class="identifier">n</span><span class="special">);</span>
<span class="identifier">an</span><span class="special">.</span><span class="identifier">change_sign_all</span><span class="special">(</span><span class="identifier">i</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">an</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -783,7 +773,6 @@
<tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -806,7 +795,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -831,7 +819,6 @@
<tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -858,7 +845,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -887,7 +873,6 @@
<tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -913,7 +898,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -971,7 +955,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1056,7 +1039,7 @@
<span class="identifier">bind</span> <span class="keyword">this</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">t</span><span class="special">)</span>
<span class="identifier">t</span><span class="special">(</span><span class="number">1</span><span class="special">);</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">int</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">0</span><span class="special">,</span>
<span class="identifier">bind</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">d</span><span class="special">,</span>
<span class="identifier">bind</span><span class="special">&</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">bind</span> <span class="keyword">this</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">{</span>
@@ -1093,7 +1076,7 @@
<span class="special">{</span> <span class="comment">// All params, const binds, and plain binds.</span>
<span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</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">int</span> <span class="identifier">y</span><span class="special">,</span> <span class="keyword">default</span> <span class="number">0</span><span class="special">,</span>
<span class="keyword">const</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="special">&</span> <span class="identifier">b</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">p</span><span class="special">,</span>
<span class="identifier">bind</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">{</span>
@@ -1123,7 +1106,7 @@
<span class="special">}</span>
<span class="special">}</span>
<span class="special">};</span>
-
+
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
<span class="identifier">s</span><span class="special">().</span><span class="identifier">f</span><span class="special">();</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
@@ -1134,7 +1117,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1219,7 +1201,7 @@
<span class="special">(</span><span class="identifier">bind</span> <span class="keyword">this</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">t</span><span class="special">)</span>
<span class="identifier">t</span><span class="special">(</span><span class="number">1</span><span class="special">);</span>
-
+
<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">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="keyword">this</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
@@ -1256,7 +1238,7 @@
<span class="special">{</span> <span class="comment">// All params, const binds, and plain binds.</span>
<span class="keyword">int</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">d</span><span class="special">;</span>
-
+
<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">int</span> <span class="identifier">y</span><span class="special">)(</span><span class="keyword">default</span> <span class="number">0</span><span class="special">)</span>
<span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span> <span class="identifier">a</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">b</span><span class="special">)</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">p</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">bind</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span><span class="special">&</span> <span class="identifier">q</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span>
@@ -1286,7 +1268,7 @@
<span class="special">}</span>
<span class="special">}</span>
<span class="special">};</span>
-
+
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
<span class="identifier">s</span><span class="special">().</span><span class="identifier">f</span><span class="special">();</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
Modified: sandbox/local/libs/local/doc/html/boost_local/Getting_Started.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Getting_Started.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Getting_Started.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -124,7 +124,7 @@
</pre>
<p>
The followings are part of the library private API, they are not documented,
- and they should not be directly used by programmers: <sup>[<a name="id866397" href="#ftn.id866397" class="footnote">2</a>]</sup>
+ and they should not be directly used by programmers: <sup>[<a name="boost_local.Getting_Started.installation.f0" href="#ftn.boost_local.Getting_Started.installation.f0" class="footnote">2</a>]</sup>
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
@@ -162,7 +162,7 @@
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id866397" href="#id866397" class="para">2</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Getting_Started.installation.f0" href="#boost_local.Getting_Started.installation.f0" class="para">2</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/Implementation.html
==============================================================================
--- sandbox/local/libs/local/doc/html/boost_local/Implementation.html (original)
+++ sandbox/local/libs/local/doc/html/boost_local/Implementation.html 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -74,7 +74,6 @@
</li>
</ol></div>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
@@ -132,7 +131,7 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">v</span><span class="special">(</span><span class="number">10</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="number">1.0</span><span class="special">);</span>
-
+
<span class="comment">// std::for_each(v.begin(), v.end(), add_local); // Error but OK on C++11.</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add_casting</span><span class="special">);</span> <span class="comment">// OK.</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">add_virtual</span><span class="special">);</span> <span class="comment">// OK.</span>
@@ -175,7 +174,6 @@
and the <code class="computeroutput"><span class="identifier">BOOST_DETAIL_PP_KEYWORD_</span><span class="special">...</span></code> macros. For example:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">keyword</span><span class="special">/</span><span class="keyword">this</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">keyword</span><span class="special">/</span><span class="keyword">const</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -210,7 +208,6 @@
section expand to code equivalent to the following:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -251,7 +248,6 @@
section expand to code equivalent to the following:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -260,10 +256,10 @@
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
<span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
<span class="keyword">double</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="keyword">double</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
-
+
<span class="comment">// The macro `BOOST_LOCAL_EXIT( (const bind& size) (bind nums) )` expands to:</span>
<span class="keyword">void</span> <span class="identifier">BOOST_LOCAL_FUNCTION_PARAMS</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">size</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">)</span>
-
+
<span class="comment">// Local exit body.</span>
<span class="special">{</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">size</span> <span class="special">&&</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
@@ -271,8 +267,8 @@
<span class="keyword">return</span><span class="special">;</span> <span class="comment">// Return this local exit (and not the enclosing scope).</span>
<span class="identifier">assert</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span> <span class="comment">// OK: Never executed.</span>
- <span class="special">}</span>
-
+ <span class="special">}</span>
+
<span class="comment">// The macro `BOOST_LOCAL_EXIT_END` expands to (at line 22):</span>
<span class="identifier">BOOST_LOCAL_FUNCTION_NAME</span><span class="special">(</span><span class="identifier">boost_local_auxXexitXfunction22</span><span class="special">)</span>
<span class="comment">// When this object goes out of scope, its destructor calls the specified</span>
@@ -296,7 +292,6 @@
Topics</a> section expand to code equivalent to the following:
</p>
<p>
-
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -320,7 +315,7 @@
<span class="comment">// DEDUCE RESULT TYPE</span>
<span class="comment">// Long name `ERROR_...` gives meaningful compiler-error message if programmers forget result type before the macro. </span>
- <span class="special">(*</span><span class="identifier">ERROR_missing_result_type_before_the_local_function_parameter_macro_id21</span><span class="special">)();</span>
+ <span class="special">(*</span><span class="identifier">ERROR_missing_result_type_before_the_local_function_parameter_macro_id21</span><span class="special">)();</span>
<span class="comment">// Use Boost.ScopeExit type deduction technique (tagging, wrapping, struct, etc) so to work on all compilers (specifically, some GCC version give internal errors otherwise).</span>
<span class="keyword">typedef</span> <span class="keyword">void</span> <span class="special">(*</span><span class="identifier">boost_local_auxXdeduce_result_tag21</span><span class="special">)(</span> <span class="keyword">int</span> <span class="identifier">ERROR_missing_result_type_before_the_local_function_parameter_macro_id21</span><span class="special">);</span>
<span class="keyword">typedef</span> <span class="identifier">BOOST_TYPEOF</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">wrap</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">deref</span><span class="special">(</span> <span class="identifier">ERROR_missing_result_type_before_the_local_function_parameter_macro_id21</span><span class="special">,</span> <span class="special">(</span><span class="identifier">boost_local_auxXdeduce_result_tag21</span><span class="special">)</span><span class="number">0</span><span class="special">)))</span> <span class="identifier">boost
_local_auxXdeduce_result_wrap21</span><span class="special">;</span>
@@ -329,12 +324,12 @@
<span class="keyword">typedef</span> <span class="identifier">boost_local_auxXdeduce_result_capture21</span> <span class="identifier">function_ptr_type</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_pointer</span><span class="special"><</span> <span class="identifier">boost_local_auxXdeduce_result_params21</span><span class="special">::</span><span class="identifier">function_ptr_type</span> <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">boost_local_auxXdeduce_result_function_type21</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXdeduce_result_function_type21</span><span class="special">>::</span><span class="identifier">result_type</span> <span class="identifier">boost_local_auxXresult_type21</span><span class="special">;</span>
-
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXdeduce_result_function_type21</span><span class="special">>::</span><span class="identifier">result_type</span> <span class="identifier">boost_local_auxXresult_type21</span><span class="special">;</span>
+
<span class="comment">// HANDLE BOUND PARAMETERS</span>
<span class="comment">// Deduce object `this` type (using technique from Boost.ScopeExit patch to support `this`).</span>
<span class="preprocessor">#if</span> <span class="identifier">BOOST_WORKAROUND</span><span class="special">(</span><span class="identifier">BOOST_MSVC</span><span class="special">,>=</span><span class="number">1300</span><span class="special">)</span>
- <span class="keyword">enum</span> <span class="special">{</span> <span class="identifier">boost_se_thistype_index_21</span> <span class="special">=</span> <span class="keyword">sizeof</span><span class="special">(*</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">msvc_typeof_this</span><span class="special">::</span><span class="identifier">encode_start</span><span class="special">(</span><span class="keyword">this</span><span class="special">))</span> <span class="special">};</span>
+ <span class="keyword">enum</span> <span class="special">{</span> <span class="identifier">boost_se_thistype_index_21</span> <span class="special">=</span> <span class="keyword">sizeof</span><span class="special">(*</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">msvc_typeof_this</span><span class="special">::</span><span class="identifier">encode_start</span><span class="special">(</span><span class="keyword">this</span><span class="special">))</span> <span class="special">};</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">msvc_typeof_this</span><span class="special">::</span><span class="identifier">msvc_typeid_wrapper</span><span class="special"><</span><span class="identifier">boost_se_thistype_index_21</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">se_this_type21</span><span class="special">;</span>
<span class="preprocessor">#else</span>
<span class="keyword">typedef</span> <span class="identifier">BOOST_TYPEOF</span><span class="special">(</span><span class="keyword">this</span><span class="special">)</span> <span class="identifier">se_this_type21</span><span class="special">;</span>
@@ -348,112 +343,112 @@
<span class="identifier">se_this_type21</span> <span class="identifier">se_this</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost_se_capture_t_0_21</span> <span class="identifier">boost_se_param_t_0_21</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">member</span><span class="special"><</span> <span class="identifier">boost_se_param_t_0_21</span><span class="special">,</span> <span class="identifier">boost_se_tag_0_21</span> <span class="special">></span> <span class="identifier">boost_se_param_0_21</span><span class="special">;</span>
- <span class="special">}</span> <span class="identifier">boost_local_auxXparams21</span> <span class="special">=</span> <span class="special">{</span>
- <span class="keyword">this</span> <span class="special">,</span>
+ <span class="special">}</span> <span class="identifier">boost_local_auxXparams21</span> <span class="special">=</span> <span class="special">{</span>
+ <span class="keyword">this</span> <span class="special">,</span>
<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND</span>
<span class="special">{</span>
<span class="preprocessor">#endif</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">deref</span><span class="special">(&</span> <span class="identifier">separator</span><span class="special">,</span> <span class="special">(</span><span class="identifier">boost_se_tag_0_21</span><span class="special">)</span><span class="number">0</span><span class="special">)</span>
<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND</span>
- <span class="special">}</span>
+ <span class="special">}</span>
<span class="preprocessor">#endif</span>
- <span class="special">};</span>
+ <span class="special">};</span>
<span class="comment">// Use variable name `...args` without line number to hold bound parameter values (so the same variable name can be used by the `NAME` macro even if it expands on a different line number).</span>
<span class="comment">// The `declared<>` template makes sure that the variable `...args` is not declared multiple times in the same context (if the variable is already declared, this template expand to a no-operation).</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">declared</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">resolve</span><span class="special"><</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">boost_local_auxXargs</span><span class="special">)</span> <span class="special">>::</span><span class="identifier">cmp1</span><span class="special"><</span><span class="number">0</span><span class="special">>::</span><span class="identifier">cmp2</span> <span class="special">></span> <span class="identifier">boost_local_auxXargs</span><span class="s
pecial">;</span>
<span class="identifier">boost_local_auxXargs</span><span class="special">.</span><span class="identifier">value</span> <span class="special">=</span> <span class="special">&</span><span class="identifier">boost_local_auxXparams21</span><span class="special">;</span>
-
+
<span class="comment">// LOCAL FUNCTOR</span>
<span class="keyword">class</span> <span class="identifier">boost_local_auxXfunctor21</span> <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="special">(</span><span class="identifier">boost_local_auxXfunction_type</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">n</span> <span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">recursion</span> <span class="special">);</span>
- <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">local</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">,</span> <span class="number">1</span> <span class="special">></span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">separatorXboost_local_auxXtypeof_type</span> <span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">se_this_type21</span> <span class="identifier">thisXboost_local_auxXtypeof_type</span> <span class="special">;</span>
- <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="special">(</span><span class="identifier">boost_local_auxXfunction_type</span><span class="special">)</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">n</span> <span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">recursion</span> <span class="special">);</span>
+ <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">local</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">,</span> <span class="number">1</span> <span class="special">></span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">separatorXboost_local_auxXtypeof_type</span> <span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">se_this_type21</span> <span class="identifier">thisXboost_local_auxXtypeof_type</span> <span class="special">;</span>
+ <span class="keyword">public</span><span class="special">:</span>
<span class="comment">// Take a generic pointer so it can be invoked by the `NAME` macro even if it expands on a different line number. </span>
<span class="keyword">inline</span> <span class="keyword">explicit</span> <span class="identifier">boost_local_auxXfunctor21</span><span class="special">(</span> <span class="keyword">void</span><span class="special">*</span> <span class="identifier">bindings</span><span class="special">)</span> <span class="special">:</span>
- <span class="identifier">boost_local_auxXbind_this</span><span class="special">(</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">bindings</span><span class="special">)-></span> <span class="identifier">se_this</span> <span class="special">)</span>
- <span class="special">,</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">(</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">bindings</span><span class="special">)-></span> <span class="identifier">boost_se_param_0_21</span><span class="special">.</span><span class="identifier">value</span> <span class="special">)</span>
- <span class="special">{</span> <span class="special">}</span>
+ <span class="identifier">boost_local_auxXbind_this</span><span class="special">(</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">bindings</span><span class="special">)-></span> <span class="identifier">se_this</span> <span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">(</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">bindings</span><span class="special">)-></span> <span class="identifier">boost_se_param_0_21</span><span class="special">.</span><span class="identifier">value</span> <span class="special">)</span>
+ <span class="special">{</span> <span class="special">}</span>
<span class="comment">// Implement `operator()` for all parameters and any combination of default parameter.</span>
<span class="keyword">inline</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="keyword">operator</span><span class="special">()(</span>
- <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
- <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg2_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg2</span>
+ <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
+ <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg2_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg2</span>
+ <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">,</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">,</span> <span class="identifier">arg1</span> <span class="special">,</span> <span class="identifier">arg2</span> <span class="special">);</span>
+ <span class="special">}</span>
+ <span class="keyword">inline</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="keyword">operator</span><span class="special">()(</span>
+ <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
<span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">,</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">,</span> <span class="identifier">arg1</span> <span class="special">,</span> <span class="identifier">arg2</span> <span class="special">);</span>
- <span class="special">}</span>
- <span class="keyword">inline</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="keyword">operator</span><span class="special">()(</span>
- <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
- <span class="special">)</span> <span class="keyword">const</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">,</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">,</span> <span class="identifier">arg1</span> <span class="special">);</span>
- <span class="special">}</span>
-
+ <span class="keyword">return</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">,</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">,</span> <span class="identifier">arg1</span> <span class="special">);</span>
+ <span class="special">}</span>
+
<span class="comment">// "Casting functor trick" to pass this local class as template parameter.</span>
- <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXcall0</span><span class="special">(</span>
- <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span>
- <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
- <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg2_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg2</span>
- <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunctor21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">object</span><span class="special">)-></span><span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">arg1</span> <span class="special">,</span> <span class="identifier">arg2</span> <span class="special">);</span>
- <span class="special">}</span>
- <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXcall1</span><span class="special">(</span>
- <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span>
- <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
- <span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunctor21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">object</span><span class="special">)-></span><span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">arg1</span> <span class="special">);</span>
- <span class="special">}</span>
- <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span> <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span><span class="special">,</span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">&</span> <span class="identifier">functor</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">functor</span><span class="special">.</span><span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span><span class="identifier">object</span><span class="special">,</span> <span class="special">&</span><span class="identifier">boost_local_auxXcall0</span> <span class="special">,</span> <span class="special">&</span><span class="identifier">boost_local_auxXcall1</span> <span class="special">);</span>
- <span class="special">}</span>
-
- <span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXcall0</span><span class="special">(</span>
+ <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span>
+ <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
+ <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg2_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg2</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunctor21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">object</span><span class="special">)-></span><span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">arg1</span> <span class="special">,</span> <span class="identifier">arg2</span> <span class="special">);</span>
+ <span class="special">}</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXcall1</span><span class="special">(</span>
+ <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span>
+ <span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">call_traits</span><span class="special"><</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_traits</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunction_type</span><span class="special">>::</span><span class="identifier">arg1_type</span><span class="special">>::</span><span class="identifier">param_type</span> <span class="identifier">arg1</span>
+ <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="keyword">static_cast</span><span class="special"><</span> <span class="identifier">boost_local_auxXfunctor21</span><span class="special">*</span> <span class="special">>(</span> <span class="identifier">object</span><span class="special">)-></span><span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">arg1</span> <span class="special">);</span>
+ <span class="special">}</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span> <span class="keyword">void</span><span class="special">*</span> <span class="identifier">object</span><span class="special">,</span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">&</span> <span class="identifier">functor</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">functor</span><span class="special">.</span><span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span><span class="identifier">object</span><span class="special">,</span> <span class="special">&</span><span class="identifier">boost_local_auxXcall0</span> <span class="special">,</span> <span class="special">&</span><span class="identifier">boost_local_auxXcall1</span> <span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
<span class="comment">// Hold bound variables (by value and reference).</span>
- <span class="identifier">se_this_type21</span> <span class="special">&</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">;</span>
- <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">;</span>
+ <span class="identifier">se_this_type21</span> <span class="special">&</span> <span class="identifier">boost_local_auxXbind_this</span> <span class="special">;</span>
+ <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">boost_local_auxXbind0</span> <span class="special">;</span>
<span class="comment">// This same declaration is first made at global scope in one of the library header files. This declaration needs to be repeated here so it is also visible from within the local function body to allow for nesting local function into one another.</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">undeclared</span> <span class="identifier">boost_local_auxXargs</span><span class="special">;</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">scope_exit</span><span class="special">::</span><span class="identifier">aux</span><span class="special">::</span><span class="identifier">undeclared</span> <span class="identifier">boost_local_auxXargs</span><span class="special">;</span>
+
<span class="comment">// The local function body.</span>
- <span class="keyword">inline</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span>
- <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">separator</span>
+ <span class="keyword">inline</span> <span class="identifier">boost_local_auxXresult_type21</span> <span class="identifier">boost_local_auxXbody</span><span class="special">(</span>
+ <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">add_const</span><span class="special"><</span> <span class="identifier">boost_se_params_t_21</span><span class="special">::</span> <span class="identifier">boost_se_param_t_0_21</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">&</span> <span class="identifier">separator</span>
<span class="special">,</span> <span class="identifier">se_this_type21</span> <span class="keyword">const</span> <span class="identifier">this_</span> <span class="comment">// Use special name `this_` instead of `this` here.</span>
<span class="comment">// Specify default parameter values here.</span>
- <span class="special">,</span> <span class="keyword">int</span> <span class="identifier">n</span> <span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">recursion</span> <span class="special">=</span> <span class="keyword">false</span>
+ <span class="special">,</span> <span class="keyword">int</span> <span class="identifier">n</span> <span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">recursion</span> <span class="special">=</span> <span class="keyword">false</span>
<span class="special">)</span> <span class="keyword">const</span>
<span class="comment">// *END* The expansion of `BOOST_LOCAL_FUNCTION_PARAMS` ends here.</span>
<span class="comment">// *BEGIN* The local function body code `{ ... }` as specified by the programmers:</span>
-
+
<span class="special">{</span>
<span class="keyword">int</span> <span class="identifier">result</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">n</span> <span class="special"><</span> <span class="number">2</span> <span class="special">)</span> <span class="identifier">result</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span>
<span class="keyword">else</span> <span class="identifier">result</span> <span class="special">=</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="keyword">true</span><span class="special">);</span> <span class="comment">// Recursive call.</span>
-
+
<span class="keyword">if</span> <span class="special">(!</span><span class="identifier">recursion</span><span class="special">)</span> <span class="identifier">this_</span><span class="special">-></span><span class="identifier">output</span> <span class="special"><<</span> <span class="identifier">result</span> <span class="special"><<</span> <span class="identifier">separator</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
- <span class="special">}</span>
-
+ <span class="special">}</span>
+
<span class="comment">// *END* The local function body `{ ... }` ends here.</span>
-
+
<span class="comment">// *BEGIN* The macro `BOOST_LOCAL_FUNCTION_NAME(recursive factorial)` expands to:</span>
- <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">public</span><span class="special">:</span>
<span class="comment">// Member variable named after the local function so the body can recursively call the local function (this must be defined here because the local function name was not known before). This must be public because it is also used to deduce the local function functor type later when when declaring the actual local function object.</span>
- <span class="identifier">boost_local_auxXfunctor_type</span> <span class="identifier">factorial</span><span class="special">;</span>
+ <span class="identifier">boost_local_auxXfunctor_type</span> <span class="identifier">factorial</span><span class="special">;</span>
<span class="comment">// Initializes the local functor member variable (this cannot be done directly within the constructor because the local function name is not known when the constructor code is expanded by the `PARAMS` macro).</span>
- <span class="keyword">inline</span> <span class="keyword">void</span> <span class="identifier">boost_local_auxXinit_recursion</span><span class="special">(</span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">&</span> <span class="identifier">functor</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">factorial</span> <span class="special">=</span> <span class="identifier">functor</span><span class="special">;</span>
- <span class="special">}</span>
+ <span class="keyword">inline</span> <span class="keyword">void</span> <span class="identifier">boost_local_auxXinit_recursion</span><span class="special">(</span> <span class="identifier">boost_local_auxXfunctor_type</span><span class="special">&</span> <span class="identifier">functor</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">factorial</span> <span class="special">=</span> <span class="identifier">functor</span><span class="special">;</span>
+ <span class="special">}</span>
<span class="comment">// Declare the local class object -- which cannot be passed as template parameter (because it is a local class). It uses the variable with the generic `...args` name to pass the bound parameter values and references (so this variable name must not contain the line number because it is used by different macros expanding on different lines).</span>
- <span class="special">}</span> <span class="identifier">boost_local_auxXfactorial</span><span class="special">(</span><span class="identifier">boost_local_auxXargs</span><span class="special">.</span><span class="identifier">value</span><span class="special">);</span>
+ <span class="special">}</span> <span class="identifier">boost_local_auxXfactorial</span><span class="special">(</span><span class="identifier">boost_local_auxXargs</span><span class="special">.</span><span class="identifier">value</span><span class="special">);</span>
<span class="comment">// Declare the actual local function object with the local function name -- which can be passed as template parameter (because it is a `boost::local::function` functor and not a local class).</span>
- <span class="identifier">BOOST_TYPEOF</span><span class="special">(</span><span class="identifier">boost_local_auxXfactorial</span><span class="special">.</span> <span class="identifier">factorial</span><span class="special">)</span> <span class="identifier">factorial</span><span class="special">;</span>
+ <span class="identifier">BOOST_TYPEOF</span><span class="special">(</span><span class="identifier">boost_local_auxXfactorial</span><span class="special">.</span> <span class="identifier">factorial</span><span class="special">)</span> <span class="identifier">factorial</span><span class="special">;</span>
<span class="comment">// Initializes casting functor to pass local function as template parameter.</span>
- <span class="identifier">boost_local_auxXfactorial</span><span class="special">.</span><span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span> <span class="special">&</span><span class="identifier">boost_local_auxXfactorial</span><span class="special">,</span> <span class="identifier">factorial</span><span class="special">);</span>
+ <span class="identifier">boost_local_auxXfactorial</span><span class="special">.</span><span class="identifier">boost_local_auxXinit_call</span><span class="special">(</span> <span class="special">&</span><span class="identifier">boost_local_auxXfactorial</span><span class="special">,</span> <span class="identifier">factorial</span><span class="special">);</span>
<span class="comment">// Initializes functor for recursion.</span>
<span class="identifier">boost_local_auxXfactorial</span><span class="special">.</span><span class="identifier">boost_local_auxXinit_recursion</span><span class="special">(</span> <span class="identifier">factorial</span><span class="special">);</span>
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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -116,12 +116,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 related line numbers retain their
- usual meaning and format. <sup>[<a name="id867107" href="#ftn.id867107" class="footnote">3</a>]</sup>
+ usual meaning and format. <sup>[<a name="boost_local.Tutorial.local_functions.f0" href="#ftn.boost_local.Tutorial.local_functions.f0" class="footnote">3</a>]</sup>
</p>
<p>
The macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
is used to end the local function definition and to specify the local function
- name. <sup>[<a name="id867143" href="#ftn.id867143" class="footnote">4</a>]</sup>
+ name. <sup>[<a name="boost_local.Tutorial.local_functions.f1" href="#ftn.boost_local.Tutorial.local_functions.f1" class="footnote">4</a>]</sup>
</p>
<p>
For example, let's program a local function named <code class="computeroutput"><span class="identifier">add</span></code>
@@ -151,7 +151,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -170,7 +169,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -311,7 +309,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -330,7 +327,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -349,7 +345,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -383,7 +378,7 @@
This library also allows to specify default values for the local function
parameters. However, the usual C++ syntax for default parameters that uses
the assignment symbol <code class="computeroutput"><span class="special">=</span></code> cannot
- be used. <sup>[<a name="id869303" href="#ftn.id869303" class="footnote">5</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
+ be used. <sup>[<a name="boost_local.Tutorial.default_parameters.f0" href="#ftn.boost_local.Tutorial.default_parameters.f0" class="footnote">5</a>]</sup> The keyword <code class="computeroutput"><span class="keyword">default</span></code>
is used instead:
</p>
<div class="informaltable"><table class="table">
@@ -446,7 +441,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -465,7 +459,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -487,7 +480,7 @@
<p>
Programmers can define a <code class="computeroutput"><span class="identifier">WITH_DEFAULT</span></code>
macro similar to the following if they think it improves readability over
- the syntax above: <sup>[<a name="id870293" href="#ftn.id870293" class="footnote">6</a>]</sup>
+ the syntax above: <sup>[<a name="boost_local.Tutorial.default_parameters.f1" href="#ftn.boost_local.Tutorial.default_parameters.f1" class="footnote">6</a>]</sup>
</p>
<div class="informaltable"><table class="table">
<colgroup>
@@ -510,7 +503,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -531,7 +523,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -562,7 +553,7 @@
variables, the object <code class="computeroutput"><span class="keyword">this</span></code>,
etc) can be bound to a local function declaration. The types of bound variables
are automatically deduced by this library using Boost.Typeof.
- <sup>[<a name="id871115" href="#ftn.id871115" class="footnote">7</a>]</sup>
+ <sup>[<a name="boost_local.Tutorial.Binding.f0" href="#ftn.boost_local.Tutorial.Binding.f0" class="footnote">7</a>]</sup>
</p>
<div class="important"><table border="0" summary="Important">
<tr>
@@ -579,7 +570,7 @@
</table></div>
<p>
This library introduces the new "keyword" <code class="computeroutput"><span class="identifier">bind</span></code>
- <sup>[<a name="id871207" href="#ftn.id871207" class="footnote">8</a>]</sup> which is used in place of the parameter type to specify the name
+ <sup>[<a name="boost_local.Tutorial.Binding.f1" href="#ftn.boost_local.Tutorial.Binding.f1" class="footnote">8</a>]</sup> which is used in place of the parameter type to specify the name
of a variable in scope to bind. The variable can be bound by value:
</p>
<pre class="programlisting"><span class="identifier">bind</span> <span class="emphasis"><em>variable-name</em></span> <span class="comment">// Bind by value.</span>
@@ -604,7 +595,7 @@
<p>
Note that when <code class="computeroutput"><span class="keyword">const</span></code> is used,
it must always precede <code class="computeroutput"><span class="identifier">bind</span></code>.
- <sup>[<a name="id871434" href="#ftn.id871434" class="footnote">9</a>]</sup>
+ <sup>[<a name="boost_local.Tutorial.Binding.f2" href="#ftn.boost_local.Tutorial.Binding.f2" class="footnote">9</a>]</sup>
</p>
<p>
If a variable is bound by value, then a copy of the variable value is taken
@@ -632,7 +623,7 @@
forced using <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span>
<span class="special">...</span></code>. (Note that binding by constant
reference is not supported by <a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions" target="_top">C++11
- lambda</a> functions but it is supported by this library.) <sup>[<a name="id871622" href="#ftn.id871622" class="footnote">10</a>]</sup>
+ lambda</a> functions but it is supported by this library.) <sup>[<a name="boost_local.Tutorial.Binding.f3" href="#ftn.boost_local.Tutorial.Binding.f3" class="footnote">10</a>]</sup>
</li>
<li class="listitem">
If a bound variable was declared as a reference in the enclosing scope,
@@ -640,7 +631,7 @@
using <code class="computeroutput"><span class="identifier">bind</span><span class="special">&</span>
<span class="special">...</span></code> or <code class="computeroutput"><span class="keyword">const</span>
<span class="identifier">bind</span><span class="special">&</span>
- <span class="special">...</span></code>. <sup>[<a name="id871742" href="#ftn.id871742" class="footnote">11</a>]</sup>
+ <span class="special">...</span></code>. <sup>[<a name="boost_local.Tutorial.Binding.f4" href="#ftn.boost_local.Tutorial.Binding.f4" class="footnote">11</a>]</sup>
</li>
</ul></div>
<p>
@@ -677,7 +668,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -701,7 +691,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -725,9 +714,9 @@
</td>
</tr></tbody>
</table></div>
-<a name="boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_"></a><h6>
-<a name="boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_-heading"></a>
- <a class="link" href="Tutorial.html#boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_">Binding
+<h6>
+<a name="boost_local.Tutorial.Binding.h0"></a>
+ <span><a name="boost_local.Tutorial.Binding.binding_the_object__code__phrase_role__keyword__this__phrase___code_"></a></span><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>
<p>
@@ -736,7 +725,7 @@
This is done by using <code class="computeroutput"><span class="keyword">this</span></code> as
the name of the variable to bind in the local function declaration and by
using the special symbol <code class="computeroutput"><span class="identifier">this_</span></code>
- <sup>[<a name="id872920" href="#ftn.id872920" class="footnote">12</a>]</sup> (instead of <code class="computeroutput"><span class="keyword">this</span></code>)
+ <sup>[<a name="boost_local.Tutorial.Binding.f5" href="#ftn.boost_local.Tutorial.Binding.f5" class="footnote">12</a>]</sup> (instead of <code class="computeroutput"><span class="keyword">this</span></code>)
to access the object within the local function body.
</p>
<p>
@@ -779,12 +768,12 @@
<p>
When the object <code class="computeroutput"><span class="keyword">this</span></code> is bound
to a local function, the local function body must use the special symbol
- <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="id873251" href="#ftn.id873251" class="footnote">13</a>]</sup>
+ <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="boost_local.Tutorial.Binding.f6" href="#ftn.boost_local.Tutorial.Binding.f6" class="footnote">13</a>]</sup>
</p>
<p>
Unfortunately, mistakenly using <code class="computeroutput"><span class="keyword">this</span></code>
within the local function body instead of <code class="computeroutput"><span class="identifier">this_</span></code>
- will not necessarily generate a compile-time error. <sup>[<a name="id873351" href="#ftn.id873351" class="footnote">14</a>]</sup> Programmers are responsible to make sure that <code class="computeroutput"><span class="keyword">this</span></code> is never used within a local function
+ will not necessarily generate a compile-time error. <sup>[<a name="boost_local.Tutorial.Binding.f7" href="#ftn.boost_local.Tutorial.Binding.f7" class="footnote">14</a>]</sup> Programmers are responsible to make sure that <code class="computeroutput"><span class="keyword">this</span></code> is never used within a local function
body which should only use the special symbol <code class="computeroutput"><span class="identifier">this_</span></code>.
</p>
</td></tr>
@@ -816,7 +805,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -870,7 +858,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -973,7 +960,7 @@
<tr><td align="left" valign="top"><p>
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 it does not return the enclosing function. <sup>[<a name="id876772" href="#ftn.id876772" class="footnote">15</a>]</sup>
+ body and it does not return the enclosing function. <sup>[<a name="boost_local.Tutorial.local_blocks.f0" href="#ftn.boost_local.Tutorial.local_blocks.f0" class="footnote">15</a>]</sup>
</p></td></tr>
</table></div>
<p>
@@ -1001,7 +988,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1027,7 +1013,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1086,7 +1071,7 @@
</tr>
<tr><td align="left" valign="top"><p>
The execution of the local exit body code is guaranteed only if the program
- does not terminate because of an uncaught exception. <sup>[<a name="id878019" href="#ftn.id878019" class="footnote">16</a>]</sup>
+ does not terminate because of an uncaught exception. <sup>[<a name="boost_local.Tutorial.local_exits.f0" href="#ftn.boost_local.Tutorial.local_exits.f0" class="footnote">16</a>]</sup>
</p></td></tr>
</table></div>
<p>
@@ -1136,7 +1121,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1145,7 +1129,7 @@
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
<span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
<span class="keyword">double</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="keyword">double</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
-
+
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">size</span><span class="special">,</span> <span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">{</span> <span class="comment">// Local exit.</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">size</span> <span class="special">&&</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Freed array: "</span> <span class="special"><<</span> <span class="identifier">nums</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
@@ -1162,7 +1146,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">exit</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -1171,7 +1154,7 @@
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
<span class="identifier">size_t</span> <span class="identifier">size</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span>
<span class="keyword">double</span><span class="special">*</span> <span class="identifier">nums</span> <span class="special">=</span> <span class="keyword">new</span> <span class="keyword">double</span><span class="special">[</span><span class="identifier">size</span><span class="special">];</span>
-
+
<span class="identifier">BOOST_LOCAL_EXIT</span><span class="special">(</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">&</span> <span class="identifier">size</span><span class="special">)</span> <span class="special">(</span><span class="identifier">bind</span> <span class="identifier">nums</span><span class="special">)</span> <span class="special">)</span> <span class="special">{</span> <span class="comment">// Local exit.</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">size</span> <span class="special">&&</span> <span class="identifier">nums</span><span class="special">)</span> <span class="keyword">delete</span><span class="special">[]</span> <span class="identifier">nums</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Freed array: "</span> <span class="special"><<</span> <span class="identifier">nums</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
@@ -1192,7 +1175,7 @@
Local exits are very similar to the <span class="emphasis"><em>scope exits</em></span> provided
by Boost.ScopeExit
with the addition that they also support constant binding and binding of
- the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="id879312" href="#ftn.id879312" class="footnote">17</a>]</sup> Local exits can be used to emulate the <a href="http://d.digitalmars.com" target="_top">D
+ the object <code class="computeroutput"><span class="keyword">this</span></code>. <sup>[<a name="boost_local.Tutorial.local_exits.f1" href="#ftn.boost_local.Tutorial.local_exits.f1" class="footnote">17</a>]</sup> Local exits can be used to emulate the <a href="http://d.digitalmars.com" target="_top">D
Programming Language</a> <span class="emphasis"><em>scope guards</em></span> (see the
<a class="link" href="Examples.html#boost_local.Examples.Emulating_Ds_Scope_Guards" title="Emulating D's Scope Guards">Emulating
D's Scope Guards</a> example).
@@ -1206,7 +1189,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="id879626" href="#ftn.id879626" class="footnote">18</a>]</sup>
+ the Reference section): <sup>[<a name="boost_local.Tutorial.templates.f0" href="#ftn.boost_local.Tutorial.templates.f0" class="footnote">18</a>]</sup>
</p>
<pre class="programlisting"><code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_PARAMS_TPL.html" title="Macro BOOST_LOCAL_FUNCTION_PARAMS_TPL">BOOST_LOCAL_FUNCTION_PARAMS_TPL</a></code><span class="special">(</span><span class="emphasis"><em>parameters</em></span><span class="special">)</span>
<code class="computeroutput"><a class="link" href="../BOOST_LOCAL_BLOCK_TPL.html" title="Macro BOOST_LOCAL_BLOCK_TPL">BOOST_LOCAL_BLOCK_TPL</a></code><span class="special">(</span><span class="emphasis"><em>bindings</em></span><span class="special">)</span>
@@ -1243,7 +1226,6 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1291,7 +1273,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1342,20 +1323,20 @@
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id867107" href="#id867107" class="para">3</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.local_functions.f0" href="#boost_local.Tutorial.local_functions.f0" class="para">3</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> If the local function body
were instead passed as a macro parameter, it would be expanded on a single
line of code (because macros always expand as a single line of code). Therefore,
eventual compiler error line numbers would all report the same value and
would no longer be useful to pinpoint the error.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id867143" href="#id867143" class="para">4</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.local_functions.f1" href="#boost_local.Tutorial.local_functions.f1" class="para">4</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> The local function name must
be passed to the macro <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
ending the function definition so this macro can declare a local variable
with the local function name to hold the local function object.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id869303" href="#id869303" class="para">5</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.default_parameters.f0" href="#boost_local.Tutorial.default_parameters.f0" class="para">5</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> The assignment symbol <code class="computeroutput"><span class="special">=</span></code> cannot be used to specify default parameter
values because default values are not part of the parameter type so they
cannot be handled using template metaprogamming. Default parameter values
@@ -1368,7 +1349,7 @@
symbol cannot be detected by preprocessor metaprogramming because it cannot
be concatenated by the preprocessor).
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id870293" href="#id870293" class="para">6</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.default_parameters.f1" href="#boost_local.Tutorial.default_parameters.f1" class="para">6</a>] </sup>
The authors do not personally find the use of the <code class="computeroutput"><span class="identifier">WITH_DEFAULT</span></code>
macro more readable and they prefer to use the <code class="computeroutput"><span class="keyword">default</span></code>
"keyword" directly. Furthermore, <code class="computeroutput"><span class="identifier">WITH_DEFAULT</span></code>
@@ -1376,7 +1357,7 @@
so it can only be defined by programmers based on the syntax they decide
to use.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id871115" href="#id871115" class="para">7</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f0" href="#boost_local.Tutorial.Binding.f0" class="para">7</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,
@@ -1389,7 +1370,7 @@
For example, this is useful for maintenance because 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.id871207" href="#id871207" class="para">8</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f1" href="#boost_local.Tutorial.Binding.f1" class="para">8</a>] </sup>
Obviously, the token <code class="computeroutput"><span class="identifier">bind</span></code>
is not a keyword of the C++ language. This library parses the token <code class="computeroutput"><span class="identifier">bind</span></code> during macro expansion using preprocessor
metaprogramming (see the <a class="link" href="Implementation.html" title="Appendix: Implementation">Implementation</a>
@@ -1398,7 +1379,7 @@
level within the syntax defined by the macros of this library -- thus it
is referred to as a "keyword" only within quotes.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id871434" href="#id871434" class="para">9</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f2" href="#boost_local.Tutorial.Binding.f2" class="para">9</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> The library macros could have
been implemented to accept both syntaxes <code class="computeroutput"><span class="keyword">const</span>
<span class="identifier">bind</span> <span class="special">...</span></code>
@@ -1409,7 +1390,7 @@
<span class="identifier">bind</span> <span class="special">...</span></code>)
is supported.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id871622" href="#id871622" class="para">10</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f3" href="#boost_local.Tutorial.Binding.f3" class="para">10</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
@@ -1424,7 +1405,7 @@
correctly 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.id871742" href="#id871742" class="para">11</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f4" href="#boost_local.Tutorial.Binding.f4" class="para">11</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> Variables originally declared
as references are bound by value unless <code class="computeroutput"><span class="special">[</span><span class="keyword">const</span><span class="special">]</span> <span class="identifier">bind</span><span class="special">&</span></code>
is used so that references can be bound by both value <code class="computeroutput"><span class="special">[</span><span class="keyword">const</span><span class="special">]</span> <span class="identifier">bind</span></code>
@@ -1437,13 +1418,13 @@
even if <code class="computeroutput"><span class="identifier">bind</span><span class="special">[&]</span></code>
is used instead of <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">bind</span><span class="special">[&]</span></code>.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id872920" href="#id872920" class="para">12</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f5" href="#boost_local.Tutorial.Binding.f5" class="para">12</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> The special name <code class="computeroutput"><span class="identifier">this_</span></code> was chosen following <a href="http://boost.2283326.n4.nabble.com/local-this-or-this-td3423912.html" target="_top">Boost
practises</a> which postfix with an underscore identifiers that are
named after keywords (the C++ keyword <code class="computeroutput"><span class="keyword">this</span></code>
in this case).
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id873251" href="#id873251" class="para">13</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f6" href="#boost_local.Tutorial.Binding.f6" class="para">13</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
@@ -1457,7 +1438,7 @@
behaviour of <code class="computeroutput"><span class="keyword">static_cast</span></code></a>
(which might not work on all platforms at the cost of portability).
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id873351" href="#id873351" class="para">14</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.Binding.f7" href="#boost_local.Tutorial.Binding.f7" class="para">14</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> The local function body cannot
be a static member function of the local functor object in order to support
recursion (because the local function name is specified by the <code class="computeroutput"><a class="link" href="../BOOST_LOCAL_FUNCTION_NAME.html" title="Macro BOOST_LOCAL_FUNCTION_NAME">BOOST_LOCAL_FUNCTION_NAME</a></code>
@@ -1470,7 +1451,7 @@
Therefore, from within the local function body the variable <code class="computeroutput"><span class="keyword">this</span></code> is visible but it refers to the local
functor and not to the bound object.
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id876772" href="#id876772" class="para">15</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.local_blocks.f0" href="#boost_local.Tutorial.local_blocks.f0" class="para">15</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),
@@ -1488,7 +1469,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.id878019" href="#id878019" class="para">16</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.local_exits.f0" href="#boost_local.Tutorial.local_exits.f0" class="para">16</a>] </sup>
<span class="bold"><strong>Rationale.</strong></span> This library (as well as
<a href="http://www.boost.org/doc/libs/release/libs/scope_exit/doc/html/index.html" target="_top">Boost.ScopeExit</a>)
uses the destructor of a local variable to automatically execute the
@@ -1499,7 +1480,7 @@
scope exit code even if the main program terminates because of an uncaught
exception.)
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id879312" href="#id879312" class="para">17</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.local_exits.f1" href="#boost_local.Tutorial.local_exits.f1" class="para">17</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"
@@ -1528,7 +1509,7 @@
name of "<a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html" target="_top">nested
functions</a>" (GCC compiler extension).
</p></div>
-<div class="footnote"><p><sup>[<a id="ftn.id879626" href="#id879626" class="para">18</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Tutorial.templates.f0" href="#boost_local.Tutorial.templates.f0" class="para">18</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-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -27,7 +27,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright © 2009-2011 Lorenzo Caminiti</p></div>
<div><div class="legalnotice">
-<a name="id808762"></a><p>
+<a name="boost_local.legal"></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>
@@ -117,9 +117,10 @@
<a href="http://www.boost.org/doc/libs/release/libs/spirit/phoenix/index.html" target="_top">Boost.Phoenix</a>,
and other C++ libraries offering related features.
</p>
-<a name="boost_local.Introduction.two_syntaxes"></a><h6>
-<a name="boost_local.Introduction.two_syntaxes-heading"></a>
- <a class="link" href="index.html#boost_local.Introduction.two_syntaxes">Two Syntaxes</a>
+<h6>
+<a name="boost_local.Introduction.h0"></a>
+ <span><a name="boost_local.Introduction.two_syntaxes"></a></span><a class="link" href="index.html#boost_local.Introduction.two_syntaxes">Two
+ Syntaxes</a>
</h6>
<p>
This library uses macros to declare the local functions, local blocks, and
@@ -151,9 +152,10 @@
Most of the examples presented in this documentation provide a side-by-side
comparison of the two syntaxes.
</p>
-<a name="boost_local.Introduction.an_example"></a><h6>
-<a name="boost_local.Introduction.an_example-heading"></a>
- <a class="link" href="index.html#boost_local.Introduction.an_example">An Example</a>
+<h6>
+<a name="boost_local.Introduction.h1"></a>
+ <span><a name="boost_local.Introduction.an_example"></a></span><a class="link" href="index.html#boost_local.Introduction.an_example">An
+ Example</a>
</h6>
<p>
In the following example, a local function is passed to the STL <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code>
@@ -192,51 +194,49 @@
<tbody><tr>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <span class="number">1.</span>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
<span class="number">2.</span>
<span class="number">3.</span>
<span class="number">4.</span>
-
+
<span class="number">5.</span>
<span class="number">6.</span>
-
-
-
+
+
+
<span class="number">7.</span>
<span class="number">8.</span>
-
+
<span class="number">9.</span>
-
-
+
+
<span class="number">10.</span>
-
+
<span class="number">11.</span>
<span class="number">12.</span>
-
+
<span class="number">13.</span>
-
-
-
+
+
+
</pre>
<p>
</p>
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -271,7 +271,7 @@
<span class="identifier">assert</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">1975.0</span><span class="special">);</span> <span class="comment">// so far `sum` is 10*100+10*90.5+10*7=1975</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Asserted summation: "</span> <span class="special"><<</span> <span class="identifier">sum</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -280,7 +280,6 @@
</td>
<td>
<p>
-
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">local</span><span class="special">/</span><span class="identifier">block</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -315,7 +314,7 @@
<span class="identifier">assert</span><span class="special">(</span><span class="identifier">sum</span> <span class="special">==</span> <span class="number">1975.0</span><span class="special">);</span> <span class="comment">// so far `sum` is 10*100+10*90.5+10*7=1975</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Asserted summation: "</span> <span class="special"><<</span> <span class="identifier">sum</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="identifier">BOOST_LOCAL_BLOCK_END</span>
-
+
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -353,7 +352,7 @@
by reference, by constant value, and by constant reference. In addition,
the object <code class="computeroutput"><span class="keyword">this</span></code> can be bound
(eventually by constant value but never by reference or constant reference
- <sup>[<a name="id865619" href="#ftn.id865619" class="footnote">1</a>]</sup> ) from within a non-static member function (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a>
+ <sup>[<a name="boost_local.Introduction.f0" href="#ftn.boost_local.Introduction.f0" class="footnote">1</a>]</sup> ) from within a non-static member function (see the <a class="link" href="boost_local/Tutorial.html" title="Tutorial">Tutorial</a>
section). For example, the variable <code class="computeroutput"><span class="identifier">factor</span></code>
is bound by constant value so it cannot be mistakenly modified by the local
function body. The variable <code class="computeroutput"><span class="identifier">sum</span></code>
@@ -429,13 +428,13 @@
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.id865619" href="#id865619" class="para">1</a>] </sup>
+<div class="footnote"><p><sup>[<a id="ftn.boost_local.Introduction.f0" href="#boost_local.Introduction.f0" class="para">1</a>] </sup>
C++ does not allow to obtain a reference to the pointer <code class="computeroutput"><span class="keyword">this</span></code>.
</p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: October 26, 2011 at 13:30:43 GMT</small></p></td>
+<td align="left"><p><small>Last revised: November 08, 2011 at 12:18:47 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/local/libs/local/example/Jamfile.jam
==============================================================================
--- sandbox/local/libs/local/example/Jamfile.jam (original)
+++ sandbox/local/libs/local/example/Jamfile.jam 2011-11-08 07:22:32 EST (Tue, 08 Nov 2011)
@@ -93,22 +93,22 @@
exe print_map : print_map.cpp ;
exe print_map_va : print_map_va.cpp ;
-exe profile_boost_local : profile_boost_local.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_boost_local_inline : profile_boost_local_inline.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_boost_local_for_loop : profile_boost_local_for_loop.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_local_functor : profile_local_functor.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_global_functor : profile_global_functor.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_0x_lambda : profile_0x_lambda.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_boost_lambda : profile_boost_lambda.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
-exe profile_boost_phoenix : profile_boost_phoenix.cpp
- ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_boost_local : profile_boost_local.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_boost_local_inline : profile_boost_local_inline.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_boost_local_for_loop : profile_boost_local_for_loop.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_local_functor : profile_local_functor.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_global_functor : profile_global_functor.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_0x_lambda : profile_0x_lambda.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_boost_lambda : profile_boost_lambda.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
+#exe profile_boost_phoenix : profile_boost_phoenix.cpp ;
+# ../../..//libboost_chrono ../../..//libboost_system ;
exe scope_guards_errno : scope_guards_errno.cpp ;
exe scope_guards_errno_va : scope_guards_errno_va.cpp ;
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