Compare commits

..

51 Commits

Author SHA1 Message Date
nobody
daabd29771 This commit was manufactured by cvs2svn to create tag
'Version_1_34_0_beta'.

[SVN r37504]
2007-04-25 05:07:34 +00:00
Dave Abrahams
ccf40a29c1 Correct testing bugs:
either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST
    (in my code only)

    or adding "return boost::report_errors();" where it was clearly
    missing (and a pure bug, in anyone's code).

    or changing BOOST_TEST to BOOST_CHECK where the integer library
    was clearly using Boost.Test and not returning report_errors().


[SVN r37063]
2007-02-25 15:28:02 +00:00
Dave Abrahams
28ed7b9704 fix table styles
[SVN r36573]
2007-01-03 17:12:34 +00:00
Dave Abrahams
6c3ee189d1 replace "write something here"
[SVN r36569]
2007-01-03 16:45:10 +00:00
Rene Rivera
15048a1d82 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Daniel Wallin
3852ff760c merged HEAD to RC
[SVN r35452]
2006-10-02 23:37:18 +00:00
Daniel Wallin
916b4d2c2f merged HEAD to RC
[SVN r35405]
2006-09-29 00:31:28 +00:00
Daniel Wallin
af9b04e7ad merged HEAD to RC
[SVN r35364]
2006-09-28 13:11:46 +00:00
Daniel Wallin
894dffe6ff merged HEAD to RC
[SVN r35360]
2006-09-28 10:22:54 +00:00
Daniel Wallin
c17ea8d26d merged HEAD to RC
[SVN r35357]
2006-09-27 20:59:14 +00:00
Daniel Wallin
1844c27699 Merged HEAD to RC.
[SVN r35339]
2006-09-26 14:49:52 +00:00
Markus Schöpflin
9694b76bf2 Merged python header inclusion fix from trunk.
[SVN r35320]
2006-09-25 10:49:42 +00:00
Daniel Wallin
7c9ddf23e0 merged HEAD to RC
[SVN r35300]
2006-09-23 22:53:35 +00:00
Daniel Wallin
224d313a05 Merged HEAD to RC.
[SVN r35285]
2006-09-23 10:41:14 +00:00
Daniel Wallin
47c53efbaa merged HEAD to RC
[SVN r35260]
2006-09-21 17:33:28 +00:00
nobody
57ef2b6ee9 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35259]
2006-09-21 17:29:16 +00:00
Dave Abrahams
297e85c0f1 fix license
[SVN r35232]
2006-09-20 17:34:41 +00:00
Dave Abrahams
3a59d2cea3 merged from HEAD
[SVN r35231]
2006-09-20 17:30:10 +00:00
Daniel Wallin
58bb633dc0 Merged HEAD to RC.
[SVN r35228]
2006-09-20 15:05:46 +00:00
nobody
3397bafb4a This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35227]
2006-09-20 15:03:36 +00:00
Daniel Wallin
cc256f0bb3 Merged HEAD to RC
[SVN r35215]
2006-09-19 18:23:18 +00:00
Dave Abrahams
e3b060b3e5 merged from HEAD
[SVN r35207]
2006-09-19 15:34:02 +00:00
Daniel Wallin
0791667e33 Merged HEAD to RC
[SVN r35197]
2006-09-19 13:13:43 +00:00
Daniel Wallin
91ffd43483 Merged changes from HEAD to RC.
[SVN r35195]
2006-09-19 11:51:07 +00:00
nobody
fa751e022e This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35193]
2006-09-19 11:47:55 +00:00
Daniel Wallin
1f6c9a3034 Merged changes from HEAD to RC_1_34_0.
[SVN r35183]
2006-09-18 20:54:56 +00:00
nobody
6c209395aa This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35179]
2006-09-18 20:47:47 +00:00
Daniel Wallin
5231f04b27 Merged changes from head to RC_1_34_0.
[SVN r35177]
2006-09-18 20:42:44 +00:00
nobody
c7258e9c9e This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35173]
2006-09-18 20:05:46 +00:00
nobody
22a1f905e9 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35170]
2006-09-18 19:56:20 +00:00
Dave Abrahams
0417a36693 merged from HEAD
[SVN r35163]
2006-09-18 18:11:49 +00:00
Dave Abrahams
d42b860b8d Sun workarounds
[SVN r35137]
2006-09-16 18:15:08 +00:00
Dave Abrahams
c5168be5d7 Parameter library Workarounds for Borland and MSVC
Parameter library explicit markup for expected failures

value_init.hpp:
  Borland workarounds
  Use angle-includes consistently


[SVN r35085]
2006-09-13 03:15:16 +00:00
Dave Abrahams
c29a75c9df merged from trunk
[SVN r35083]
2006-09-13 00:40:00 +00:00
Dave Abrahams
e18d621508 Add missing license/copyright
[SVN r35070]
2006-09-11 22:27:29 +00:00
nobody
40399d3505 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35043]
2006-09-08 09:38:01 +00:00
Daniel Wallin
d6db8c6216 Merged name.hpp from HEAD.
[SVN r34945]
2006-08-24 21:13:51 +00:00
Daniel Wallin
38817a8bb5 fixed missing include
[SVN r34941]
2006-08-24 16:19:14 +00:00
Dave Abrahams
646c519dc0 merged from trunk
[SVN r34930]
2006-08-23 13:01:56 +00:00
Daniel Wallin
cb501f9f38 merged changes from HEAD
[SVN r34921]
2006-08-22 17:36:58 +00:00
Dave Abrahams
7eb7737095 merged from trunk
[SVN r34918]
2006-08-22 14:01:34 +00:00
Daniel Wallin
bfc5811fdc Merged HEAD to RC_1_34_0.
[SVN r34899]
2006-08-16 22:34:35 +00:00
Daniel Wallin
1f8f44b26c Merged changes from HEAD to RC_1_34_0.
[SVN r34898]
2006-08-16 22:30:07 +00:00
Dave Abrahams
6729c38504 Borland workaround
[SVN r34808]
2006-08-02 19:07:09 +00:00
Dave Abrahams
cf5d2c46f5 Workarounds for Borland
[SVN r34805]
2006-08-02 16:16:36 +00:00
nobody
49e928273d This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r34788]
2006-07-30 21:33:23 +00:00
Gennaro Prota
00bbfbb20c boost guidelines (mainly from inspect tool: tabs, license reference text, etc.); more to do...
[SVN r34753]
2006-07-27 11:48:49 +00:00
Dave Abrahams
ca120a3f04 merged from trunk
[SVN r34696]
2006-07-24 14:38:01 +00:00
Dave Abrahams
e2b452c1f4 merged from trunk
[SVN r34290]
2006-06-12 20:00:14 +00:00
Rene Rivera
6695f76c5f [merge from head] Allow keywords to be copyable and default constructable, to facilitate use of keywords outside of Boost.Parameter.
[SVN r33691]
2006-04-13 20:12:20 +00:00
nobody
bf25a637c8 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
14 changed files with 365 additions and 891 deletions

View File

@@ -95,81 +95,81 @@ or copy at <a class="reference" href="http://www.boost.org/LICENSE_1_0.txt">http
<div class="contents topic">
<p class="topic-title first"><a id="table-of-contents" name="table-of-contents"><strong>Table of Contents</strong></a></p>
<ul class="auto-toc simple">
<li><a class="reference" href="#motivation" id="id21" name="id21">1&nbsp;&nbsp;&nbsp;Motivation</a><ul class="auto-toc">
<li><a class="reference" href="#named-function-parameters" id="id22" name="id22">1.1&nbsp;&nbsp;&nbsp;Named Function Parameters</a></li>
<li><a class="reference" href="#deduced-function-parameters" id="id23" name="id23">1.2&nbsp;&nbsp;&nbsp;Deduced Function Parameters</a></li>
<li><a class="reference" href="#class-template-parameter-support" id="id24" name="id24">1.3&nbsp;&nbsp;&nbsp;Class Template Parameter Support</a></li>
<li><a class="reference" href="#motivation" id="id23" name="id23">1&nbsp;&nbsp;&nbsp;Motivation</a><ul class="auto-toc">
<li><a class="reference" href="#named-function-parameters" id="id24" name="id24">1.1&nbsp;&nbsp;&nbsp;Named Function Parameters</a></li>
<li><a class="reference" href="#deduced-function-parameters" id="id25" name="id25">1.2&nbsp;&nbsp;&nbsp;Deduced Function Parameters</a></li>
<li><a class="reference" href="#class-template-parameter-support" id="id26" name="id26">1.3&nbsp;&nbsp;&nbsp;Class Template Parameter Support</a></li>
</ul>
</li>
<li><a class="reference" href="#tutorial" id="id25" name="id25">2&nbsp;&nbsp;&nbsp;Tutorial</a><ul class="auto-toc">
<li><a class="reference" href="#parameter-enabled-functions" id="id26" name="id26">2.1&nbsp;&nbsp;&nbsp;Parameter-Enabled Functions</a><ul class="auto-toc">
<li><a class="reference" href="#headers-and-namespaces" id="id27" name="id27">2.1.1&nbsp;&nbsp;&nbsp;Headers And Namespaces</a></li>
<li><a class="reference" href="#the-abstract-interface-to-dfs" id="id28" name="id28">2.1.2&nbsp;&nbsp;&nbsp;The Abstract Interface to <tt class="docutils literal"><span class="pre">depth_first_search</span></tt></a></li>
<li><a class="reference" href="#defining-the-keywords" id="id29" name="id29">2.1.3&nbsp;&nbsp;&nbsp;Defining the Keywords</a></li>
<li><a class="reference" href="#writing-the-function" id="id30" name="id30">2.1.4&nbsp;&nbsp;&nbsp;Writing the Function</a></li>
<li><a class="reference" href="#function-signatures" id="id31" name="id31">2.1.5&nbsp;&nbsp;&nbsp;Function Signatures</a><ul class="auto-toc">
<li><a class="reference" href="#required-parameters" id="id32" name="id32">2.1.5.1&nbsp;&nbsp;&nbsp;Required Parameters</a></li>
<li><a class="reference" href="#optional-parameters" id="id33" name="id33">2.1.5.2&nbsp;&nbsp;&nbsp;Optional Parameters</a></li>
<li><a class="reference" href="#handling-out-parameters" id="id34" name="id34">2.1.5.3&nbsp;&nbsp;&nbsp;Handling “Out” Parameters</a></li>
<li><a class="reference" href="#positional-arguments" id="id35" name="id35">2.1.5.4&nbsp;&nbsp;&nbsp;Positional Arguments</a></li>
<li><a class="reference" href="#default-expression-evaluation" id="id36" name="id36">2.1.5.5&nbsp;&nbsp;&nbsp;Default Expression Evaluation</a></li>
<li><a class="reference" href="#signature-matching-and-overloading" id="id37" name="id37">2.1.5.6&nbsp;&nbsp;&nbsp;Signature Matching and Overloading</a><ul class="auto-toc">
<li><a class="reference" href="#adding-type-requirements" id="id38" name="id38">2.1.5.6.1&nbsp;&nbsp;&nbsp;Adding Type Requirements</a></li>
<li><a class="reference" href="#predicate-requirements" id="id39" name="id39">2.1.5.6.2&nbsp;&nbsp;&nbsp;Predicate Requirements</a></li>
<li><a class="reference" href="#tutorial" id="id27" name="id27">2&nbsp;&nbsp;&nbsp;Tutorial</a><ul class="auto-toc">
<li><a class="reference" href="#parameter-enabled-functions" id="id28" name="id28">2.1&nbsp;&nbsp;&nbsp;Parameter-Enabled Functions</a><ul class="auto-toc">
<li><a class="reference" href="#headers-and-namespaces" id="id29" name="id29">2.1.1&nbsp;&nbsp;&nbsp;Headers And Namespaces</a></li>
<li><a class="reference" href="#the-abstract-interface-to-dfs" id="id30" name="id30">2.1.2&nbsp;&nbsp;&nbsp;The Abstract Interface to <tt class="docutils literal"><span class="pre">depth_first_search</span></tt></a></li>
<li><a class="reference" href="#defining-the-keywords" id="id31" name="id31">2.1.3&nbsp;&nbsp;&nbsp;Defining the Keywords</a></li>
<li><a class="reference" href="#writing-the-function" id="id32" name="id32">2.1.4&nbsp;&nbsp;&nbsp;Writing the Function</a></li>
<li><a class="reference" href="#function-signatures" id="id33" name="id33">2.1.5&nbsp;&nbsp;&nbsp;Function Signatures</a><ul class="auto-toc">
<li><a class="reference" href="#required-parameters" id="id34" name="id34">2.1.5.1&nbsp;&nbsp;&nbsp;Required Parameters</a></li>
<li><a class="reference" href="#optional-parameters" id="id35" name="id35">2.1.5.2&nbsp;&nbsp;&nbsp;Optional Parameters</a></li>
<li><a class="reference" href="#handling-out-parameters" id="id36" name="id36">2.1.5.3&nbsp;&nbsp;&nbsp;Handling “Out” Parameters</a></li>
<li><a class="reference" href="#positional-arguments" id="id37" name="id37">2.1.5.4&nbsp;&nbsp;&nbsp;Positional Arguments</a></li>
<li><a class="reference" href="#default-expression-evaluation" id="id38" name="id38">2.1.5.5&nbsp;&nbsp;&nbsp;Default Expression Evaluation</a></li>
<li><a class="reference" href="#signature-matching-and-overloading" id="id39" name="id39">2.1.5.6&nbsp;&nbsp;&nbsp;Signature Matching and Overloading</a><ul class="auto-toc">
<li><a class="reference" href="#adding-type-requirements" id="id40" name="id40">2.1.5.6.1&nbsp;&nbsp;&nbsp;Adding Type Requirements</a></li>
<li><a class="reference" href="#predicate-requirements" id="id41" name="id41">2.1.5.6.2&nbsp;&nbsp;&nbsp;Predicate Requirements</a></li>
</ul>
</li>
<li><a class="reference" href="#deduced-parameters" id="id40" name="id40">2.1.5.7&nbsp;&nbsp;&nbsp;Deduced Parameters</a></li>
<li><a class="reference" href="#deduced-parameters" id="id42" name="id42">2.1.5.7&nbsp;&nbsp;&nbsp;Deduced Parameters</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#parameter-enabled-member-functions" id="id41" name="id41">2.2&nbsp;&nbsp;&nbsp;Parameter-Enabled Member Functions</a></li>
<li><a class="reference" href="#parameter-enabled-constructors" id="id42" name="id42">2.3&nbsp;&nbsp;&nbsp;Parameter-Enabled Constructors</a></li>
<li><a class="reference" href="#parameter-enabled-class-templates" id="id43" name="id43">2.4&nbsp;&nbsp;&nbsp;Parameter-Enabled Class Templates</a><ul class="auto-toc">
<li><a class="reference" href="#named-template-parameters" id="id44" name="id44">2.4.1&nbsp;&nbsp;&nbsp;Named Template Parameters</a><ul class="auto-toc">
<li><a class="reference" href="#template-keywords" id="id45" name="id45">2.4.1.1&nbsp;&nbsp;&nbsp;Template Keywords</a></li>
<li><a class="reference" href="#class-template-skeleton" id="id46" name="id46">2.4.1.2&nbsp;&nbsp;&nbsp;Class Template Skeleton</a></li>
<li><a class="reference" href="#class-template-signatures" id="id47" name="id47">2.4.1.3&nbsp;&nbsp;&nbsp;Class Template Signatures</a></li>
<li><a class="reference" href="#argument-packs-and-parameter-extraction" id="id48" name="id48">2.4.1.4&nbsp;&nbsp;&nbsp;Argument Packs and Parameter Extraction</a></li>
<li><a class="reference" href="#parameter-enabled-member-functions" id="id43" name="id43">2.2&nbsp;&nbsp;&nbsp;Parameter-Enabled Member Functions</a></li>
<li><a class="reference" href="#parameter-enabled-constructors" id="id44" name="id44">2.3&nbsp;&nbsp;&nbsp;Parameter-Enabled Constructors</a></li>
<li><a class="reference" href="#parameter-enabled-class-templates" id="id45" name="id45">2.4&nbsp;&nbsp;&nbsp;Parameter-Enabled Class Templates</a><ul class="auto-toc">
<li><a class="reference" href="#named-template-parameters" id="id46" name="id46">2.4.1&nbsp;&nbsp;&nbsp;Named Template Parameters</a><ul class="auto-toc">
<li><a class="reference" href="#template-keywords" id="id47" name="id47">2.4.1.1&nbsp;&nbsp;&nbsp;Template Keywords</a></li>
<li><a class="reference" href="#class-template-skeleton" id="id48" name="id48">2.4.1.2&nbsp;&nbsp;&nbsp;Class Template Skeleton</a></li>
<li><a class="reference" href="#class-template-signatures" id="id49" name="id49">2.4.1.3&nbsp;&nbsp;&nbsp;Class Template Signatures</a></li>
<li><a class="reference" href="#argument-packs-and-parameter-extraction" id="id50" name="id50">2.4.1.4&nbsp;&nbsp;&nbsp;Argument Packs and Parameter Extraction</a></li>
</ul>
</li>
<li><a class="reference" href="#exercising-the-code-so-far" id="id49" name="id49">2.4.2&nbsp;&nbsp;&nbsp;Exercising the Code So Far</a></li>
<li><a class="reference" href="#deduced-template-parameters" id="id50" name="id50">2.4.3&nbsp;&nbsp;&nbsp;Deduced Template Parameters</a></li>
<li><a class="reference" href="#exercising-the-code-so-far" id="id51" name="id51">2.4.2&nbsp;&nbsp;&nbsp;Exercising the Code So Far</a></li>
<li><a class="reference" href="#deduced-template-parameters" id="id52" name="id52">2.4.3&nbsp;&nbsp;&nbsp;Deduced Template Parameters</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#advanced-topics" id="id51" name="id51">3&nbsp;&nbsp;&nbsp;Advanced Topics</a><ul class="auto-toc">
<li><a class="reference" href="#fine-grained-name-control" id="id52" name="id52">3.1&nbsp;&nbsp;&nbsp;Fine-Grained Name Control</a></li>
<li><a class="reference" href="#more-argumentpacks" id="id53" name="id53">3.2&nbsp;&nbsp;&nbsp;More <span class="concept">ArgumentPack</span>s</a><ul class="auto-toc">
<li><a class="reference" href="#building-argumentpacks" id="id54" name="id54">3.2.1&nbsp;&nbsp;&nbsp;Building <span class="concept">ArgumentPack</span>s</a></li>
<li><a class="reference" href="#extracting-parameter-types" id="id55" name="id55">3.2.2&nbsp;&nbsp;&nbsp;Extracting Parameter Types</a></li>
<li><a class="reference" href="#lazy-default-computation" id="id56" name="id56">3.2.3&nbsp;&nbsp;&nbsp;Lazy Default Computation</a></li>
<li><a class="reference" href="#advanced-topics" id="id53" name="id53">3&nbsp;&nbsp;&nbsp;Advanced Topics</a><ul class="auto-toc">
<li><a class="reference" href="#fine-grained-name-control" id="id54" name="id54">3.1&nbsp;&nbsp;&nbsp;Fine-Grained Name Control</a></li>
<li><a class="reference" href="#more-argumentpacks" id="id55" name="id55">3.2&nbsp;&nbsp;&nbsp;More <span class="concept">ArgumentPack</span>s</a><ul class="auto-toc">
<li><a class="reference" href="#building-argumentpacks" id="id56" name="id56">3.2.1&nbsp;&nbsp;&nbsp;Building <span class="concept">ArgumentPack</span>s</a></li>
<li><a class="reference" href="#extracting-parameter-types" id="id57" name="id57">3.2.2&nbsp;&nbsp;&nbsp;Extracting Parameter Types</a></li>
<li><a class="reference" href="#lazy-default-computation" id="id58" name="id58">3.2.3&nbsp;&nbsp;&nbsp;Lazy Default Computation</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference" href="#best-practices" id="id57" name="id57">4&nbsp;&nbsp;&nbsp;Best Practices</a><ul class="auto-toc">
<li><a class="reference" href="#keyword-naming" id="id58" name="id58">4.1&nbsp;&nbsp;&nbsp;Keyword Naming</a></li>
<li><a class="reference" href="#namespaces" id="id59" name="id59">4.2&nbsp;&nbsp;&nbsp;Namespaces</a></li>
<li><a class="reference" href="#documentation" id="id60" name="id60">4.3&nbsp;&nbsp;&nbsp;Documentation</a></li>
<li><a class="reference" href="#best-practices" id="id59" name="id59">4&nbsp;&nbsp;&nbsp;Best Practices</a><ul class="auto-toc">
<li><a class="reference" href="#keyword-naming" id="id60" name="id60">4.1&nbsp;&nbsp;&nbsp;Keyword Naming</a></li>
<li><a class="reference" href="#namespaces" id="id61" name="id61">4.2&nbsp;&nbsp;&nbsp;Namespaces</a></li>
<li><a class="reference" href="#documentation" id="id62" name="id62">4.3&nbsp;&nbsp;&nbsp;Documentation</a></li>
</ul>
</li>
<li><a class="reference" href="#portability-considerations" id="id61" name="id61">5&nbsp;&nbsp;&nbsp;Portability Considerations</a><ul class="auto-toc">
<li><a class="reference" href="#no-sfinae-support" id="id62" name="id62">5.1&nbsp;&nbsp;&nbsp;No SFINAE Support</a></li>
<li><a class="reference" href="#no-support-for-result-of" id="id63" name="id63">5.2&nbsp;&nbsp;&nbsp;No Support for <tt class="docutils literal"><span class="pre">result_of</span></tt></a></li>
<li><a class="reference" href="#compiler-can-t-see-references-in-unnamed-namespace" id="id64" name="id64">5.3&nbsp;&nbsp;&nbsp;Compiler Can't See References In Unnamed Namespace</a></li>
<li><a class="reference" href="#portability-considerations" id="id63" name="id63">5&nbsp;&nbsp;&nbsp;Portability Considerations</a><ul class="auto-toc">
<li><a class="reference" href="#no-sfinae-support" id="id64" name="id64">5.1&nbsp;&nbsp;&nbsp;No SFINAE Support</a></li>
<li><a class="reference" href="#no-support-for-result-of" id="id65" name="id65">5.2&nbsp;&nbsp;&nbsp;No Support for <tt class="docutils literal"><span class="pre">result_of</span></tt></a></li>
<li><a class="reference" href="#compiler-can-t-see-references-in-unnamed-namespace" id="id66" name="id66">5.3&nbsp;&nbsp;&nbsp;Compiler Can't See References In Unnamed Namespace</a></li>
</ul>
</li>
<li><a class="reference" href="#python-binding" id="id65" name="id65">6&nbsp;&nbsp;&nbsp;Python Binding</a></li>
<li><a class="reference" href="#reference" id="id66" name="id66">7&nbsp;&nbsp;&nbsp;Reference</a></li>
<li><a class="reference" href="#glossary" id="id67" name="id67">8&nbsp;&nbsp;&nbsp;Glossary</a></li>
<li><a class="reference" href="#acknowledgements" id="id68" name="id68">9&nbsp;&nbsp;&nbsp;Acknowledgements</a></li>
<li><a class="reference" href="#python-binding" id="id67" name="id67">6&nbsp;&nbsp;&nbsp;Python Binding</a></li>
<li><a class="reference" href="#reference" id="id68" name="id68">7&nbsp;&nbsp;&nbsp;Reference</a></li>
<li><a class="reference" href="#glossary" id="id69" name="id69">8&nbsp;&nbsp;&nbsp;Glossary</a></li>
<li><a class="reference" href="#acknowledgements" id="id70" name="id70">9&nbsp;&nbsp;&nbsp;Acknowledgements</a></li>
</ul>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id21" id="motivation" name="motivation">1&nbsp;&nbsp;&nbsp;Motivation</a></h1>
<h1><a class="toc-backref" href="#id23" id="motivation" name="motivation">1&nbsp;&nbsp;&nbsp;Motivation</a></h1>
<p>In C++, <a class="reference" href="#arguments">arguments</a> are normally given meaning by their positions
with respect to a <a class="reference" href="#parameter">parameter</a> list: the first argument passed maps
onto the first parameter in a function's definition, and so on.
@@ -219,7 +219,7 @@ arguments either, leading to hard-to-find bugs.</p>
</ul>
<!-- @ignore(3) -->
<div class="section">
<h2><a class="toc-backref" href="#id22" id="named-function-parameters" name="named-function-parameters">1.1&nbsp;&nbsp;&nbsp;Named Function Parameters</a></h2>
<h2><a class="toc-backref" href="#id24" id="named-function-parameters" name="named-function-parameters">1.1&nbsp;&nbsp;&nbsp;Named Function Parameters</a></h2>
<div class="compound">
<p class="compound-first">This library addresses the problems outlined above by associating
each parameter name with a keyword object. Now users can identify
@@ -231,7 +231,7 @@ window* w = new_window(&quot;alert box&quot;, <strong>movable_=</strong>false);
<!-- @ignore() -->
</div>
<div class="section">
<h2><a class="toc-backref" href="#id23" id="deduced-function-parameters" name="deduced-function-parameters">1.2&nbsp;&nbsp;&nbsp;Deduced Function Parameters</a></h2>
<h2><a class="toc-backref" href="#id25" id="deduced-function-parameters" name="deduced-function-parameters">1.2&nbsp;&nbsp;&nbsp;Deduced Function Parameters</a></h2>
<div class="compound">
<p class="compound-first">A <strong>deduced parameter</strong> can be passed in any position <em>without</em>
supplying an explicit parameter name. It's not uncommon for a
@@ -252,7 +252,7 @@ names.</p>
<!-- @ignore() -->
</div>
<div class="section">
<h2><a class="toc-backref" href="#id24" id="class-template-parameter-support" name="class-template-parameter-support">1.3&nbsp;&nbsp;&nbsp;Class Template Parameter Support</a></h2>
<h2><a class="toc-backref" href="#id26" id="class-template-parameter-support" name="class-template-parameter-support">1.3&nbsp;&nbsp;&nbsp;Class Template Parameter Support</a></h2>
<div class="compound">
<p class="compound-first">The reasoning we've given for named and deduced parameter
interfaces applies equally well to class templates as it does to
@@ -278,12 +278,12 @@ smart_ptr&lt;<strong>Client</strong>, <strong>shared</strong>&gt; q;
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id25" id="tutorial" name="tutorial">2&nbsp;&nbsp;&nbsp;Tutorial</a></h1>
<h1><a class="toc-backref" href="#id27" id="tutorial" name="tutorial">2&nbsp;&nbsp;&nbsp;Tutorial</a></h1>
<p>This tutorial shows all the basics—how to build both named- and deduced-parameter
interfaces to function templates and class templates—and several
more advanced idioms as well.</p>
<div class="section">
<h2><a class="toc-backref" href="#id26" id="parameter-enabled-functions" name="parameter-enabled-functions">2.1&nbsp;&nbsp;&nbsp;Parameter-Enabled Functions</a></h2>
<h2><a class="toc-backref" href="#id28" id="parameter-enabled-functions" name="parameter-enabled-functions">2.1&nbsp;&nbsp;&nbsp;Parameter-Enabled Functions</a></h2>
<p>In this section we'll show how the Parameter library can be used to
build an expressive interface to the <a class="reference" href="../../../graph/index.html">Boost Graph library</a>'s
<a class="reference" href="../../../graph/doc/depth_first_search.html"><tt class="docutils literal"><span class="pre">depth_first_search</span></tt></a> algorithm.<a class="footnote-reference" href="#old-interface" id="id2" name="id2"><sup>1</sup></a></p>
@@ -298,7 +298,7 @@ streamline the implementation of named parameter interfaces,
improve their participation in overload resolution, and optimize
their runtime efficiency. -->
<div class="section">
<h3><a class="toc-backref" href="#id27" id="headers-and-namespaces" name="headers-and-namespaces">2.1.1&nbsp;&nbsp;&nbsp;Headers And Namespaces</a></h3>
<h3><a class="toc-backref" href="#id29" id="headers-and-namespaces" name="headers-and-namespaces">2.1.1&nbsp;&nbsp;&nbsp;Headers And Namespaces</a></h3>
<p>Most components of the Parameter library are declared in a
header named for the component. For example,</p>
<pre class="literal-block">
@@ -324,7 +324,7 @@ namespace parameter = boost::parameter;
<tt class="docutils literal"><span class="pre">boost::parameter::xxx</span></tt>.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id28" id="the-abstract-interface-to-dfs" name="the-abstract-interface-to-dfs">2.1.2&nbsp;&nbsp;&nbsp;The Abstract Interface to <tt class="docutils literal"><span class="pre">depth_first_search</span></tt></a></h3>
<h3><a class="toc-backref" href="#id30" id="the-abstract-interface-to-dfs" name="the-abstract-interface-to-dfs">2.1.2&nbsp;&nbsp;&nbsp;The Abstract Interface to <tt class="docutils literal"><span class="pre">depth_first_search</span></tt></a></h3>
<p>The Graph library's <tt class="docutils literal"><span class="pre">depth_first_search</span></tt> algorithm is a generic function accepting
from one to four arguments by reference. If all arguments were
required, its signature might be as follows:</p>
@@ -342,7 +342,7 @@ void depth_first_search(
<!-- @ignore() -->
<p>However, most of the parameters have a useful default value, as
shown in the table below.</p>
<table border="1" class="docutils" id="default-expressions">
<table border="1" class="docutils table" id="default-expressions">
<span id="parameter-table"></span><caption><a id="default-expressions" name="default-expressions"><span id="parameter-table"></span><tt class="docutils literal"><span class="pre">depth_first_search</span></tt> Parameters</a></caption>
<colgroup>
<col width="17%" />
@@ -401,7 +401,7 @@ columns above. For the purposes of this exercise, you don't need
to understand them in detail.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id29" id="defining-the-keywords" name="defining-the-keywords">2.1.3&nbsp;&nbsp;&nbsp;Defining the Keywords</a></h3>
<h3><a class="toc-backref" href="#id31" id="defining-the-keywords" name="defining-the-keywords">2.1.3&nbsp;&nbsp;&nbsp;Defining the Keywords</a></h3>
<p>The point of this exercise is to make it possible to call
<tt class="docutils literal"><span class="pre">depth_first_search</span></tt> with named arguments, leaving out any
arguments for which the default is appropriate:</p>
@@ -462,7 +462,7 @@ templates that are instantiated in multiple translation
units (MSVC6.x users see <a class="reference" href="#compiler-can-t-see-references-in-unnamed-namespace">this note</a>).</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id30" id="writing-the-function" name="writing-the-function">2.1.4&nbsp;&nbsp;&nbsp;Writing the Function</a></h3>
<h3><a class="toc-backref" href="#id32" id="writing-the-function" name="writing-the-function">2.1.4&nbsp;&nbsp;&nbsp;Writing the Function</a></h3>
<p>Now that we have our keywords defined, the function template
definition follows a simple pattern using the
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION</span></tt> macro:</p>
@@ -524,7 +524,7 @@ match the function's parameter names.</li>
</ol>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id31" id="function-signatures" name="function-signatures">2.1.5&nbsp;&nbsp;&nbsp;Function Signatures</a></h3>
<h3><a class="toc-backref" href="#id33" id="function-signatures" name="function-signatures">2.1.5&nbsp;&nbsp;&nbsp;Function Signatures</a></h3>
<p>Function signatures are described as one or two adjacent
parenthesized terms (a <a class="reference" href="../../../preprocessor/index.html">Boost.Preprocessor</a> <a class="reference" href="http://boost-consulting.com/mplbook/preprocessor.html#sequences">sequence</a>) describing
the function's parameters in the order in which they'd be expected
@@ -532,7 +532,7 @@ if passed positionally. Any required parameters must come first,
but the <tt class="docutils literal"><span class="pre">(required</span> <span class="pre"></span> <span class="pre">)</span></tt> clause can be omitted when all the
parameters are optional.</p>
<div class="section">
<h4><a class="toc-backref" href="#id32" id="required-parameters" name="required-parameters">2.1.5.1&nbsp;&nbsp;&nbsp;Required Parameters</a></h4>
<h4><a class="toc-backref" href="#id34" id="required-parameters" name="required-parameters">2.1.5.1&nbsp;&nbsp;&nbsp;Required Parameters</a></h4>
<div class="compound">
<p class="compound-first">Required parameters are given first—nested in a <tt class="docutils literal"><span class="pre">(required</span> <span class="pre"></span> <span class="pre">)</span></tt>
clause—as a series of two-element tuples describing each parameter
@@ -560,15 +560,14 @@ BOOST_PARAMETER_FUNCTION((void), f, tag,
<!-- @test('compile') -->
</div>
<div class="section">
<h4><a class="toc-backref" href="#id33" id="optional-parameters" name="optional-parameters">2.1.5.2&nbsp;&nbsp;&nbsp;Optional Parameters</a></h4>
<h4><a class="toc-backref" href="#id35" id="optional-parameters" name="optional-parameters">2.1.5.2&nbsp;&nbsp;&nbsp;Optional Parameters</a></h4>
<div class="compound">
<p class="compound-first">Optional parameters—nested in an <tt class="docutils literal"><span class="pre">(optional</span> <span class="pre"></span> <span class="pre">)</span></tt> clause—are given
as a series of adjacent <em>three</em>-element tuples describing the
parameter name, any requirements on the argument type, <em>and</em> and an
expression representing the parameter's default value:</p>
<pre class="compound-last literal-block">
(optional
<strong>(visitor, *, boost::dfs_visitor&lt;&gt;())
(optional <strong> (visitor, *, boost::dfs_visitor&lt;&gt;())
(root_vertex, *, *vertices(graph).first)
(index_map, *, get(boost::vertex_index,graph))
(in_out(color_map), *,
@@ -601,7 +600,7 @@ BOOST_PARAMETER_FUNCTION((void), f, tag,
<!-- @test('compile') -->
</div>
<div class="section">
<h4><a class="toc-backref" href="#id34" id="handling-out-parameters" name="handling-out-parameters">2.1.5.3&nbsp;&nbsp;&nbsp;Handling “Out” Parameters</a></h4>
<h4><a class="toc-backref" href="#id36" id="handling-out-parameters" name="handling-out-parameters">2.1.5.3&nbsp;&nbsp;&nbsp;Handling “Out” Parameters</a></h4>
<div class="compound">
<p class="compound-first">Within the function body, a parameter name such as <tt class="docutils literal"><span class="pre">visitor</span></tt> is
a <em>C++ reference</em>, bound either to an actual argument passed by
@@ -613,9 +612,9 @@ indicate that <tt class="docutils literal"><span class="pre">color_map</span></t
its name in <tt class="docutils literal"><span class="pre">in_out(…)</span></tt>:</p>
<pre class="compound-last literal-block">
(optional
(visitor, *, boost::dfs_visitor&lt;&gt;())
(root_vertex, *, *vertices(graph).first)
(index_map, *, get(boost::vertex_index,graph))
(visitor, *, boost::dfs_visitor&lt;&gt;())
(root_vertex, *, *vertices(graph).first)
(index_map, *, get(boost::vertex_index,graph))
(<strong>in_out(color_map)</strong>, *,
default_color_map(num_vertices(graph), index_map) )
)
@@ -651,7 +650,7 @@ difference between <tt class="docutils literal"><span class="pre">out</span></tt
both so you can make your interfaces more self-documenting.</p>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id35" id="positional-arguments" name="positional-arguments">2.1.5.4&nbsp;&nbsp;&nbsp;Positional Arguments</a></h4>
<h4><a class="toc-backref" href="#id37" id="positional-arguments" name="positional-arguments">2.1.5.4&nbsp;&nbsp;&nbsp;Positional Arguments</a></h4>
<p>When arguments are passed positionally (without the use of
keywords), they will be mapped onto parameters in the order the
parameters are given in the signature, so for example in this
@@ -664,7 +663,7 @@ graphs::depth_first_search(x, y);
be interpreted as a visitor.</p>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id36" id="default-expression-evaluation" name="default-expression-evaluation">2.1.5.5&nbsp;&nbsp;&nbsp;Default Expression Evaluation</a></h4>
<h4><a class="toc-backref" href="#id38" id="default-expression-evaluation" name="default-expression-evaluation">2.1.5.5&nbsp;&nbsp;&nbsp;Default Expression Evaluation</a></h4>
<div class="compound">
<p class="compound-first">Note that in our example, the value of the graph parameter is
used in the default expressions for <tt class="docutils literal"><span class="pre">root_vertex</span></tt>,
@@ -738,7 +737,7 @@ BOOST_PARAMETER_NAME(color_map)''') -->
<!-- @test('compile') -->
</div>
<div class="section">
<h4><a class="toc-backref" href="#id37" id="signature-matching-and-overloading" name="signature-matching-and-overloading">2.1.5.6&nbsp;&nbsp;&nbsp;Signature Matching and Overloading</a></h4>
<h4><a class="toc-backref" href="#id39" id="signature-matching-and-overloading" name="signature-matching-and-overloading">2.1.5.6&nbsp;&nbsp;&nbsp;Signature Matching and Overloading</a></h4>
<p>In fact, the function signature is so general that any call to
<tt class="docutils literal"><span class="pre">depth_first_search</span></tt> with fewer than five arguments will match
our function, provided we pass <em>something</em> for the required
@@ -766,7 +765,7 @@ signatures have been the subject of much discussion, especially
in the presence of <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">unqualified calls</a>. If all we want is to
avoid unintentional argument-dependent lookup (ADL), we can
isolate <tt class="docutils literal"><span class="pre">depth_first_search</span></tt> in a namespace containing no
types<a class="footnote-reference" href="#using" id="id7" name="id7"><sup>6</sup></a>, but suppose we <em>want</em> it to found via ADL?</li>
types<a class="footnote-reference" href="#using" id="id7" name="id7"><sup>7</sup></a>, but suppose we <em>want</em> it to found via ADL?</li>
</ol>
<p>It's usually a good idea to prevent functions from being considered
for overload resolution when the passed argument types aren't
@@ -792,7 +791,7 @@ depth_first_search(boost::adjacency_list&lt;&gt;(), 2, &quot;hello&quot;);
</pre>
<!-- @ignore() -->
<div class="section">
<h5><a class="toc-backref" href="#id38" id="adding-type-requirements" name="adding-type-requirements">2.1.5.6.1&nbsp;&nbsp;&nbsp;Adding Type Requirements</a></h5>
<h5><a class="toc-backref" href="#id40" id="adding-type-requirements" name="adding-type-requirements">2.1.5.6.1&nbsp;&nbsp;&nbsp;Adding Type Requirements</a></h5>
<p>We really don't want the compiler to consider the original version
of <tt class="docutils literal"><span class="pre">depth_first_search</span></tt> because the <tt class="docutils literal"><span class="pre">root_vertex</span></tt> argument,
<tt class="docutils literal"><span class="pre">&quot;hello&quot;</span></tt>, doesn't meet the <a class="reference" href="#parameter-table">requirement</a> that it match the
@@ -819,7 +818,7 @@ general, to access the type of any parameter <em>foo</em>, write <em>foo</em><tt
</div>
</div>
<div class="section">
<h5><a class="toc-backref" href="#id39" id="predicate-requirements" name="predicate-requirements">2.1.5.6.2&nbsp;&nbsp;&nbsp;Predicate Requirements</a></h5>
<h5><a class="toc-backref" href="#id41" id="predicate-requirements" name="predicate-requirements">2.1.5.6.2&nbsp;&nbsp;&nbsp;Predicate Requirements</a></h5>
<p>The requirements on other arguments are a bit more interesting than
those on <tt class="docutils literal"><span class="pre">root_vertex</span></tt>; they can't be described in terms of simple
type matching. Instead, they must be described in terms of <a class="reference" href="../../../mpl/doc/refmanual/metafunction.html">MPL
@@ -922,7 +921,7 @@ with <a class="reference" href="http://www.generic-programming.org/software/Conc
</div>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id40" id="deduced-parameters" name="deduced-parameters">2.1.5.7&nbsp;&nbsp;&nbsp;Deduced Parameters</a></h4>
<h4><a class="toc-backref" href="#id42" id="deduced-parameters" name="deduced-parameters">2.1.5.7&nbsp;&nbsp;&nbsp;Deduced Parameters</a></h4>
<p>To illustrate deduced parameter support we'll have to leave behind
our example from the Graph library. Instead, consider the example
of the <a class="reference" href="../../../python/doc/v2/def.html"><tt class="docutils literal"><span class="pre">def</span></tt></a> function from <a class="reference" href="../../../python/doc/index.html">Boost.Python</a>. Its signature is
@@ -967,14 +966,14 @@ BOOST_PARAMETER_FUNCTION(
(docstring, (char const*), &quot;&quot;)
(keywords
, *(is_keyword_expression&lt;mpl::_&gt;) // see<a class="footnote-reference" href="#is-keyword-expression" id="id12" name="id12"><sup>5</sup></a>
, *(is_keyword_expression&lt;mpl::_&gt;) // see<a class="footnote-reference" href="#is-keyword-expression" id="id12" name="id12"><sup>6</sup></a>
, no_keywords())
(policies
, *(mpl::not_&lt;
mpl::or_&lt;
boost::is_convertible&lt;mpl::_, char const*&gt;
, is_keyword_expression&lt;mpl::_&gt; // see<a class="footnote-reference" href="#is-keyword-expression" id="id13" name="id13"><sup>5</sup></a>
, is_keyword_expression&lt;mpl::_&gt; // see<a class="footnote-reference" href="#is-keyword-expression" id="id13" name="id13"><sup>6</sup></a>
&gt;
&gt;)
, default_call_policies()
@@ -1023,15 +1022,15 @@ void f()
''') -->
<div class="admonition-syntax-note admonition">
<p class="first admonition-title">Syntax Note</p>
<p class="last">A <tt class="docutils literal"><span class="pre">(deduced&nbsp;…)</span></tt> clause always contains a&nbsp;``(required&nbsp;…)``
and/or an&nbsp;``(optional&nbsp;…)`` subclause, and must follow any
<tt class="docutils literal"><span class="pre">(required&nbsp;…)</span></tt> or&nbsp;``(optional&nbsp;…)`` clauses indicating
<p class="last">A <tt class="docutils literal"><span class="pre">(deduced</span> <span class="pre">…)</span></tt> clause always contains a <tt class="docutils literal"><span class="pre">(required</span> <span class="pre">…)</span></tt>
and/or an <tt class="docutils literal"><span class="pre">(optional</span> <span class="pre">…)</span></tt> subclause, and must follow any
<tt class="docutils literal"><span class="pre">(required</span> <span class="pre">…)</span></tt> or <tt class="docutils literal"><span class="pre">(optional</span> <span class="pre">…)</span></tt> clauses indicating
nondeduced parameters at the outer level.</p>
</div>
<p>With the declaration above, the following two calls are equivalent:</p>
<pre class="literal-block">
def(&quot;f&quot;, &amp;f, <strong>some_policies</strong>, <strong>&quot;Documentation for f&quot;</strong>);
def(&quot;f&quot;, &amp;f, <strong>&quot;Documentation for f&quot;</strong>, <strong>some_policies</strong>);
def(&quot;f&quot;, f, <strong>some_policies</strong>, <strong>&quot;Documentation for f&quot;</strong>);
def(&quot;f&quot;, f, <strong>&quot;Documentation for f&quot;</strong>, <strong>some_policies</strong>);
</pre>
<!-- @example.prepend('''
int main()
@@ -1041,7 +1040,7 @@ for some reason, convertible to <tt class="docutils literal"><span class="pre">c
specify the parameter name explicitly, as follows:</p>
<pre class="literal-block">
def(
&quot;f&quot;, &amp;f
&quot;f&quot;, f
, <strong>_policies = some_policies</strong>, &quot;Documentation for f&quot;);
</pre>
<!-- @example.append('}') -->
@@ -1050,7 +1049,7 @@ def(
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id41" id="parameter-enabled-member-functions" name="parameter-enabled-member-functions">2.2&nbsp;&nbsp;&nbsp;Parameter-Enabled Member Functions</a></h2>
<h2><a class="toc-backref" href="#id43" id="parameter-enabled-member-functions" name="parameter-enabled-member-functions">2.2&nbsp;&nbsp;&nbsp;Parameter-Enabled Member Functions</a></h2>
<p>The <tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MEMBER_FUNCTION</span></tt> and
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_CONST_MEMBER_FUNCTION</span></tt> macros accept exactly the
same arguments as <tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION</span></tt>, but are designed to
@@ -1069,8 +1068,7 @@ struct callable2
};
</pre>
<!-- @example.prepend('''
#include <boost/parameter.hpp>
#include <iostream>''') -->
#include <boost/parameter.hpp>''') -->
<!-- @test('compile') -->
<p>These macros don't directly allow a function's interface to be
separated from its implementation, but you can always forward
@@ -1095,7 +1093,7 @@ BOOST_PARAMETER_NAME(arg2)''') -->
<!-- @test('compile') -->
</div>
<div class="section">
<h2><a class="toc-backref" href="#id42" id="parameter-enabled-constructors" name="parameter-enabled-constructors">2.3&nbsp;&nbsp;&nbsp;Parameter-Enabled Constructors</a></h2>
<h2><a class="toc-backref" href="#id44" id="parameter-enabled-constructors" name="parameter-enabled-constructors">2.3&nbsp;&nbsp;&nbsp;Parameter-Enabled Constructors</a></h2>
<p>The lack of a “delegating constructor”
feature in C++
(<a class="reference" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf</a>)
@@ -1156,7 +1154,7 @@ myclass z(&quot;june&quot;); // positional/defaulted
section.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id43" id="parameter-enabled-class-templates" name="parameter-enabled-class-templates">2.4&nbsp;&nbsp;&nbsp;Parameter-Enabled Class Templates</a></h2>
<h2><a class="toc-backref" href="#id45" id="parameter-enabled-class-templates" name="parameter-enabled-class-templates">2.4&nbsp;&nbsp;&nbsp;Parameter-Enabled Class Templates</a></h2>
<p>In this section we'll use Boost.Parameter to build <a class="reference" href="../../../python/doc/index.html">Boost.Python</a>'s <a class="reference" href="http://www.boost.org/libs/python/doc/v2/class.html#class_-spec">class_</a> template, whose “signature” is:</p>
<pre class="literal-block">
template class&lt;
@@ -1168,7 +1166,7 @@ class class_;
<!-- @ignore() -->
<p>Only the first argument, <tt class="docutils literal"><span class="pre">ValueType</span></tt>, is required.</p>
<div class="section">
<h3><a class="toc-backref" href="#id44" id="named-template-parameters" name="named-template-parameters">2.4.1&nbsp;&nbsp;&nbsp;Named Template Parameters</a></h3>
<h3><a class="toc-backref" href="#id46" id="named-template-parameters" name="named-template-parameters">2.4.1&nbsp;&nbsp;&nbsp;Named Template Parameters</a></h3>
<p>First, we'll build an interface that allows users to pass arguments
positionally or by name:</p>
<pre class="literal-block">
@@ -1185,7 +1183,7 @@ class_&lt;
</pre>
<!-- @ignore() -->
<div class="section">
<h4><a class="toc-backref" href="#id45" id="template-keywords" name="template-keywords">2.4.1.1&nbsp;&nbsp;&nbsp;Template Keywords</a></h4>
<h4><a class="toc-backref" href="#id47" id="template-keywords" name="template-keywords">2.4.1.1&nbsp;&nbsp;&nbsp;Template Keywords</a></h4>
<p>The first step is to define keywords for each template parameter:</p>
<pre class="literal-block">
namespace boost { namespace python {
@@ -1218,7 +1216,7 @@ struct class_type
<em>parameter passing template</em> named <tt class="docutils literal"><span class="pre">class_type</span></tt>.</p>
</div>
<div class="section">
<h4><a class="toc-backref" href="#id46" id="class-template-skeleton" name="class-template-skeleton">2.4.1.2&nbsp;&nbsp;&nbsp;Class Template Skeleton</a></h4>
<h4><a class="toc-backref" href="#id48" id="class-template-skeleton" name="class-template-skeleton">2.4.1.2&nbsp;&nbsp;&nbsp;Class Template Skeleton</a></h4>
<p>The next step is to define the skeleton of our class template,
which has three optional parameters. Because the user may pass
arguments in any order, we don't know the actual identities of
@@ -1247,7 +1245,7 @@ struct class_
<!-- @test('compile') -->
</div>
<div class="section">
<h4><a class="toc-backref" href="#id47" id="class-template-signatures" name="class-template-signatures">2.4.1.3&nbsp;&nbsp;&nbsp;Class Template Signatures</a></h4>
<h4><a class="toc-backref" href="#id49" id="class-template-signatures" name="class-template-signatures">2.4.1.3&nbsp;&nbsp;&nbsp;Class Template Signatures</a></h4>
<p>Next, we need to build a type, known as a <a class="reference" href="reference.html#parameterspec"><span class="concept">ParameterSpec</span></a>,
describing the “signature” of <tt class="docutils literal"><span class="pre">boost::python::class_</span></tt>. A
<a class="reference" href="reference.html#parameterspec"><span class="concept">ParameterSpec</span></a> enumerates the required and optional parameters in
@@ -1290,7 +1288,7 @@ struct bases
}}''') -->
</div>
<div class="section">
<h4><a class="toc-backref" href="#id48" id="argument-packs-and-parameter-extraction" name="argument-packs-and-parameter-extraction"><span id="binding-intro"></span>2.4.1.4&nbsp;&nbsp;&nbsp;Argument Packs and Parameter Extraction</a></h4>
<h4><a class="toc-backref" href="#id50" id="argument-packs-and-parameter-extraction" name="argument-packs-and-parameter-extraction"><span id="binding-intro"></span>2.4.1.4&nbsp;&nbsp;&nbsp;Argument Packs and Parameter Extraction</a></h4>
<p>Next, within the body of <tt class="docutils literal"><span class="pre">class_</span></tt> , we use the <span class="concept">ParameterSpec</span>'s nested <tt class="docutils literal"><span class="pre">::bind&lt;</span> <span class="pre"></span> <span class="pre">&gt;</span></tt> template to bundle the actual arguments
into an <a class="reference" href="reference.html#argumentpack"><span class="concept">ArgumentPack</span></a> type, and then use the library's <tt class="docutils literal"><span class="pre">binding&lt;</span>
<span class="pre"></span> <span class="pre">&gt;</span></tt> metafunction to extract “logical parameters”. Note that
@@ -1331,7 +1329,7 @@ struct class_
</div>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id49" id="exercising-the-code-so-far" name="exercising-the-code-so-far">2.4.2&nbsp;&nbsp;&nbsp;Exercising the Code So Far</a></h3>
<h3><a class="toc-backref" href="#id51" id="exercising-the-code-so-far" name="exercising-the-code-so-far">2.4.2&nbsp;&nbsp;&nbsp;Exercising the Code So Far</a></h3>
<div class="compound">
<p class="compound-first">Revisiting our original examples,</p>
<pre class="compound-middle literal-block">
@@ -1372,7 +1370,7 @@ BOOST_MPL_ASSERT((boost::is_same&lt;c2::copyable, void&gt;));
<!-- @test('compile', howmany='all') -->
</div>
<div class="section">
<h3><a class="toc-backref" href="#id50" id="deduced-template-parameters" name="deduced-template-parameters">2.4.3&nbsp;&nbsp;&nbsp;Deduced Template Parameters</a></h3>
<h3><a class="toc-backref" href="#id52" id="deduced-template-parameters" name="deduced-template-parameters">2.4.3&nbsp;&nbsp;&nbsp;Deduced Template Parameters</a></h3>
<p>To apply a deduced parameter interface here, we need only make the
type requirements a bit tighter so the <tt class="docutils literal"><span class="pre">held_type</span></tt> and
<tt class="docutils literal"><span class="pre">copyable</span></tt> parameters can be crisply distinguished from the
@@ -1499,11 +1497,11 @@ BOOST_MPL_ASSERT((boost::is_same<c2::copyable, void>));''') -->
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id51" id="advanced-topics" name="advanced-topics">3&nbsp;&nbsp;&nbsp;Advanced Topics</a></h1>
<h1><a class="toc-backref" href="#id53" id="advanced-topics" name="advanced-topics">3&nbsp;&nbsp;&nbsp;Advanced Topics</a></h1>
<p>At this point, you should have a good grasp of the basics. In this
section we'll cover some more esoteric uses of the library.</p>
<div class="section">
<h2><a class="toc-backref" href="#id52" id="fine-grained-name-control" name="fine-grained-name-control">3.1&nbsp;&nbsp;&nbsp;Fine-Grained Name Control</a></h2>
<h2><a class="toc-backref" href="#id54" id="fine-grained-name-control" name="fine-grained-name-control">3.1&nbsp;&nbsp;&nbsp;Fine-Grained Name Control</a></h2>
<p>If you don't like the leading-underscore naming convention used
to refer to keyword objects, or you need the name <tt class="docutils literal"><span class="pre">tag</span></tt> for
something other than the keyword type namespace, there's another
@@ -1534,14 +1532,14 @@ int main()
section on <a class="reference" href="#keyword-naming">best practices for keyword object naming</a>.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id53" id="more-argumentpacks" name="more-argumentpacks">3.2&nbsp;&nbsp;&nbsp;More <span class="concept">ArgumentPack</span>s</a></h2>
<h2><a class="toc-backref" href="#id55" id="more-argumentpacks" name="more-argumentpacks">3.2&nbsp;&nbsp;&nbsp;More <span class="concept">ArgumentPack</span>s</a></h2>
<p>We've already seen <span class="concept">ArgumentPack</span>s when we looked at
<a class="reference" href="#parameter-enabled-constructors">parameter-enabled constructors</a> and <a class="reference" href="#binding-intro">class templates</a>. As you
might have guessed, <span class="concept">ArgumentPack</span>s actually lie at the heart of
everything this library does; in this section we'll examine ways to
build and manipulate them more effectively.</p>
<div class="section">
<h3><a class="toc-backref" href="#id54" id="building-argumentpacks" name="building-argumentpacks">3.2.1&nbsp;&nbsp;&nbsp;Building <span class="concept">ArgumentPack</span>s</a></h3>
<h3><a class="toc-backref" href="#id56" id="building-argumentpacks" name="building-argumentpacks">3.2.1&nbsp;&nbsp;&nbsp;Building <span class="concept">ArgumentPack</span>s</a></h3>
<p>The simplest <span class="concept">ArgumentPack</span> is the result of assigning into a
keyword object:</p>
<pre class="literal-block">
@@ -1587,10 +1585,7 @@ parameter::parameters&lt;
, optional&lt;tag::index, is_convertible&lt;_,int&gt; &gt;
&gt; spec;
char const sam[] = &quot;sam&quot;;
int twelve = 12;
int z0 = print_name_and_index( <strong>spec(</strong>sam, twelve<strong>)</strong> );
int z0 = print_name_and_index( <strong>spec(</strong>&quot;sam&quot;, 12<strong>)</strong> );
int z1 = print_name_and_index(
<strong>spec(</strong>_index=12, _name=&quot;sam&quot;<strong>)</strong>
@@ -1606,11 +1601,9 @@ using boost::mpl::_;''') -->
int main()
{}''') -->
<!-- @test('run', howmany='all') -->
<p>Note that because of the <a class="reference" href="http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm">forwarding problem</a>, <tt class="docutils literal"><span class="pre">parameter::parameters::operator()</span></tt>
can't accept non-const rvalues.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id55" id="extracting-parameter-types" name="extracting-parameter-types">3.2.2&nbsp;&nbsp;&nbsp;Extracting Parameter Types</a></h3>
<h3><a class="toc-backref" href="#id57" id="extracting-parameter-types" name="extracting-parameter-types">3.2.2&nbsp;&nbsp;&nbsp;Extracting Parameter Types</a></h3>
<p>If we want to know the types of the arguments passed to
<tt class="docutils literal"><span class="pre">print_name_and_index</span></tt>, we have a couple of options. The
simplest and least error-prone approach is to forward them to a
@@ -1655,9 +1648,7 @@ case we can use the <tt class="docutils literal"><span class="pre">binding&lt;</
BOOST_PARAMETER_NAME(index)
template &lt;class ArgumentPack&gt;
typename remove_reference&lt;
typename parameter::binding&lt;ArgumentPack, tag::index, int&gt;::type
&gt;::type
typename parameter::binding&lt;ArgumentPack, tag::index, int&gt;::type
twice_index(ArgumentPack const&amp; args)
{
return 2 * args[_index|42];
@@ -1665,40 +1656,21 @@ twice_index(ArgumentPack const&amp; args)
int six = twice_index(_index = 3);
</pre>
<!-- TODO: binding<> returns a reference. We should use value_type<> here. -->
<!-- @example.prepend('''
#include <boost/parameter.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <cassert>
namespace parameter = boost::parameter;
using boost::remove_reference;''') -->
<p>Note that the <tt class="docutils literal"><span class="pre">remove_reference&lt;</span> <span class="pre"></span> <span class="pre">&gt;</span></tt> dance is necessary because
<tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre"></span> <span class="pre">&gt;</span></tt> will return a reference type when the argument
is bound in the argument pack. If we don't strip the reference we
end up returning a reference to the temporary created in the <tt class="docutils literal"><span class="pre">2*…</span></tt>
expression. A convenient shortcut would be to use the <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre"></span> <span class="pre">&gt;</span></tt>
metafunction:</p>
<pre class="literal-block">
template &lt;class ArgumentPack&gt;
typename <strong>parameter::value_type&lt;ArgumentPack, tag::index, int&gt;</strong>::type
twice_index(ArgumentPack const&amp; args)
{
return 2 * args[_index|42];
}
</pre>
<!-- @example.wrap('namespace with_value_type {', '''
int six = twice_index(_index = 3);
}''') -->
namespace parameter = boost::parameter;''') -->
<!-- @example.append('''
int main()
{
assert(six == 6);
assert(with_value_type::six == 6);
}''') -->
<!-- @test('run', howmany='all') -->
<!-- @test('run') -->
</div>
<div class="section">
<h3><a class="toc-backref" href="#id56" id="lazy-default-computation" name="lazy-default-computation">3.2.3&nbsp;&nbsp;&nbsp;Lazy Default Computation</a></h3>
<h3><a class="toc-backref" href="#id58" id="lazy-default-computation" name="lazy-default-computation">3.2.3&nbsp;&nbsp;&nbsp;Lazy Default Computation</a></h3>
<p>When a default value is expensive to compute, it would be
preferable to avoid it until we're sure it's absolutely necessary.
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION</span></tt> takes care of that problem for us, but
@@ -1734,27 +1706,19 @@ int main()
<p>In the example above, the string <tt class="docutils literal"><span class="pre">&quot;hello,</span> <span class="pre">world&quot;</span></tt> is constructed
despite the fact that the user passed us a value for <tt class="docutils literal"><span class="pre">s3</span></tt>. To
remedy that, we can compute the default value <em>lazily</em> (that is,
only on demand), by using <tt class="docutils literal"><span class="pre">boost::bind()</span></tt> to create a function
object.</p>
<!-- danielw: I'm leaving the text below in the source, because we might -->
<!-- want to change back to it after 1.34, and if I remove it now we -->
<!-- might forget about it. -->
<!-- by combining the logical-or (“``||``”) operator -->
<!-- with a function object built by the Boost Lambda_ library: [#bind]_ -->
only on demand), by combining the logical-or (“``||``”) operator
with a function object built by the Boost <a class="reference" href="../../../lambda/index.html">Lambda</a> library:<a class="footnote-reference" href="#bind" id="id17" name="id17"><sup>5</sup></a></p>
<pre class="literal-block">
using boost::bind;
using boost::ref;
namespace lambda = boost::lambda;
typename parameter::binding&lt;
ArgumentPack, tag::s3, std::string
&gt;::type s3 = args[_s3 <strong>|| bind(std::plus&lt;std::string&gt;(), ref(s1), ref(s2))</strong> ];
&gt;::type s3 = args[_s3 <strong>|| (lambda::var(s1)+lambda::var(s2))</strong> ];
</pre>
<!-- @example.prepend('''
#include <boost/bind.hpp>
#include <boost/ref.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/parameter.hpp>
#include <string>
#include <functional>
namespace parameter = boost::parameter;
@@ -1776,7 +1740,6 @@ std::string x = f((_s1="hello,", _s2=" world", _s3="hi world"));
int main()
{}''') -->
<!-- @test('run') -->
<!-- .. _Lambda: ../../../lambda/index.html -->
<div class="sidebar">
<p class="first sidebar-title">Mnemonics</p>
<p class="last">To remember the difference between <tt class="docutils literal"><span class="pre">|</span></tt> and <tt class="docutils literal"><span class="pre">||</span></tt>, recall that
@@ -1785,24 +1748,20 @@ argument is only evaluated if its first argument is <tt class="docutils literal"
Similarly, in <tt class="docutils literal"><span class="pre">color_map[param||f]</span></tt>, <tt class="docutils literal"><span class="pre">f</span></tt> is only invoked if
no <tt class="docutils literal"><span class="pre">color_map</span></tt> argument was supplied.</p>
</div>
<p>The expression <tt class="docutils literal"><span class="pre">bind(std::plus&lt;std::string&gt;(),</span> <span class="pre">ref(s1),</span> <span class="pre">ref(s2))</span></tt> yields
a <em>function object</em> that, when invoked, adds the two strings together.
That function will only be invoked if no <tt class="docutils literal"><span class="pre">s3</span></tt> argument is supplied by
the caller.</p>
<!-- The expression ``lambda::var(s1)+lambda::var(s2)`` yields a -->
<!-- *function object* that, when invoked, adds the two strings -->
<!-- together. That function will only be invoked if no ``s3`` argument -->
<!-- is supplied by the caller. -->
<p>The expression <tt class="docutils literal"><span class="pre">lambda::var(s1)+lambda::var(s2)</span></tt> yields a
<em>function object</em> that, when invoked, adds the two strings
together. That function will only be invoked if no <tt class="docutils literal"><span class="pre">s3</span></tt> argument
is supplied by the caller.</p>
</div>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id57" id="best-practices" name="best-practices">4&nbsp;&nbsp;&nbsp;Best Practices</a></h1>
<h1><a class="toc-backref" href="#id59" id="best-practices" name="best-practices">4&nbsp;&nbsp;&nbsp;Best Practices</a></h1>
<p>By now you should have a fairly good idea of how to use the
Parameter library. This section points out a few more-marginal
issues that will help you use the library more effectively.</p>
<div class="section">
<h2><a class="toc-backref" href="#id58" id="keyword-naming" name="keyword-naming">4.1&nbsp;&nbsp;&nbsp;Keyword Naming</a></h2>
<h2><a class="toc-backref" href="#id60" id="keyword-naming" name="keyword-naming">4.1&nbsp;&nbsp;&nbsp;Keyword Naming</a></h2>
<p><tt class="docutils literal"><span class="pre">BOOST_PARAMETER_NAME</span></tt> prepends a leading underscore to the names
of all our keyword objects in order to avoid the following
usually-silent bug:</p>
@@ -1855,7 +1814,7 @@ compiler—might become irretrievably ambiguous with those in our
unnamed namespace.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id59" id="namespaces" name="namespaces">4.2&nbsp;&nbsp;&nbsp;Namespaces</a></h2>
<h2><a class="toc-backref" href="#id61" id="namespaces" name="namespaces">4.2&nbsp;&nbsp;&nbsp;Namespaces</a></h2>
<p>In our examples we've always declared keyword objects in (an
unnamed namespace within) the same namespace as the
Boost.Parameter-enabled functions using those keywords:</p>
@@ -1959,7 +1918,7 @@ int y = lib::f(_name = &quot;bob&quot;, _index = 2);
<!-- @test('run', howmany='all') -->
</div>
<div class="section">
<h2><a class="toc-backref" href="#id60" id="documentation" name="documentation">4.3&nbsp;&nbsp;&nbsp;Documentation</a></h2>
<h2><a class="toc-backref" href="#id62" id="documentation" name="documentation">4.3&nbsp;&nbsp;&nbsp;Documentation</a></h2>
<p>The interface idioms enabled by Boost.Parameter are completely new
(to C++), and as such are not served by pre-existing documentation
conventions.</p>
@@ -1973,13 +1932,13 @@ sharing.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id61" id="portability-considerations" name="portability-considerations">5&nbsp;&nbsp;&nbsp;Portability Considerations</a></h1>
<h1><a class="toc-backref" href="#id63" id="portability-considerations" name="portability-considerations">5&nbsp;&nbsp;&nbsp;Portability Considerations</a></h1>
<p>Use the <a class="reference" href="http://www.boost.org/regression/release/user/parameter.html">regression test results</a> for the latest Boost release of
the Parameter library to see how it fares on your favorite
compiler. Additionally, you may need to be aware of the following
issues and workarounds for particular compilers.</p>
<div class="section">
<h2><a class="toc-backref" href="#id62" id="no-sfinae-support" name="no-sfinae-support">5.1&nbsp;&nbsp;&nbsp;No SFINAE Support</a></h2>
<h2><a class="toc-backref" href="#id64" id="no-sfinae-support" name="no-sfinae-support">5.1&nbsp;&nbsp;&nbsp;No SFINAE Support</a></h2>
<p>Some older compilers don't support SFINAE. If your compiler meets
that criterion, then Boost headers will <tt class="docutils literal"><span class="pre">#define</span></tt> the preprocessor
symbol <tt class="docutils literal"><span class="pre">BOOST_NO_SFINAE</span></tt>, and parameter-enabled functions won't be
@@ -2027,7 +1986,7 @@ are unspecified, the workaround is to use
.. |BOOST_PARAMETER_MATCH| replace:: ``BOOST_PARAMETER_MATCH`` -->
</div>
<div class="section">
<h2><a class="toc-backref" href="#id64" id="compiler-can-t-see-references-in-unnamed-namespace" name="compiler-can-t-see-references-in-unnamed-namespace">5.3&nbsp;&nbsp;&nbsp;Compiler Can't See References In Unnamed Namespace</a></h2>
<h2><a class="toc-backref" href="#id66" id="compiler-can-t-see-references-in-unnamed-namespace" name="compiler-can-t-see-references-in-unnamed-namespace">5.3&nbsp;&nbsp;&nbsp;Compiler Can't See References In Unnamed Namespace</a></h2>
<p>If you use Microsoft Visual C++ 6.x, you may find that the compiler
has trouble finding your keyword objects. This problem has been
observed, but only on this one compiler, and it disappeared as the
@@ -2048,17 +2007,17 @@ namespace graphs
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id65" id="python-binding" name="python-binding">6&nbsp;&nbsp;&nbsp;Python Binding</a></h1>
<h1><a class="toc-backref" href="#id67" id="python-binding" name="python-binding">6&nbsp;&nbsp;&nbsp;Python Binding</a></h1>
<p>Follow <a class="reference" href="python.html">this link</a> for documentation on how to expose
Boost.Parameter-enabled functions to Python with <a class="reference" href="../../../python/doc/index.html">Boost.Python</a>.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id66" id="reference" name="reference">7&nbsp;&nbsp;&nbsp;Reference</a></h1>
<h1><a class="toc-backref" href="#id68" id="reference" name="reference">7&nbsp;&nbsp;&nbsp;Reference</a></h1>
<p>Follow <a class="reference" href="reference.html">this link</a> to the Boost.Parameter reference
documentation.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id67" id="glossary" name="glossary">8&nbsp;&nbsp;&nbsp;Glossary</a></h1>
<h1><a class="toc-backref" href="#id69" id="glossary" name="glossary">8&nbsp;&nbsp;&nbsp;Glossary</a></h1>
<table class="docutils field-list" frame="void" id="arguments" rules="none">
<col class="field-name" />
<col class="field-body" />
@@ -2088,7 +2047,7 @@ int y = f(3);
</table>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id68" id="acknowledgements" name="acknowledgements">9&nbsp;&nbsp;&nbsp;Acknowledgements</a></h1>
<h1><a class="toc-backref" href="#id70" id="acknowledgements" name="acknowledgements">9&nbsp;&nbsp;&nbsp;Acknowledgements</a></h1>
<p>The authors would like to thank all the Boosters who participated
in the review of this library and its documentation, most
especially our review manager, Doug Gregor.</p>
@@ -2128,23 +2087,30 @@ library wouldn't suffer.</td></tr>
<tr><td class="label"><a class="fn-backref" href="#id6" name="conceptcpp">[4]</a></td><td>This is a major motivation behind <a class="reference" href="http://www.generic-programming.org/software/ConceptGCC/">ConceptC++</a>.</td></tr>
</tbody>
</table>
<!-- .. [#bind] The Lambda library is known not to work on `some -->
<!-- less-conformant compilers`__. When using one of those you could -->
<!-- use `Boost.Bind`_ to generate the function object:: -->
<!-- boost::bind(std::plus<std::string>(),s1,s2) -->
<table class="docutils footnote" frame="void" id="bind" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id17" name="bind">[5]</a></td><td><p class="first">The Lambda library is known not to work on <a class="reference" href="http://www.boost.org/regression/release/user/lambda.html">some
less-conformant compilers</a>. When using one of those you could
use <a class="reference" href="../../../bind/index.html">Boost.Bind</a> to generate the function object:</p>
<pre class="last literal-block">
boost::bind(std::plus&lt;std::string&gt;(),s1,s2)
</pre>
</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="is-keyword-expression" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a name="is-keyword-expression">[5]</a></td><td><em>(<a class="fn-backref" href="#id12">1</a>, <a class="fn-backref" href="#id13">2</a>)</em> Here we're assuming there's a predicate
<tr><td class="label"><a name="is-keyword-expression">[6]</a></td><td><em>(<a class="fn-backref" href="#id12">1</a>, <a class="fn-backref" href="#id13">2</a>)</em> Here we're assuming there's a predicate
metafunction <tt class="docutils literal"><span class="pre">is_keyword_expression</span></tt> that can be used to
identify models of Boost.Python's KeywordExpression concept.</td></tr>
</tbody>
</table>
<!-- .. __ http://www.boost.org/regression/release/user/lambda.html -->
<table class="docutils footnote" frame="void" id="using" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id7" name="using">[6]</a></td><td><p class="first">You can always give the illusion that the function
<tr><td class="label"><a class="fn-backref" href="#id7" name="using">[7]</a></td><td><p class="first">You can always give the illusion that the function
lives in an outer namespace by applying a <em>using-declaration</em>:</p>
<pre class="last literal-block">
namespace foo_overloads
@@ -2164,9 +2130,9 @@ lookup is due to Herb Sutter.
<table class="docutils footnote" frame="void" id="sfinae" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a name="sfinae">[7]</a></td><td>This capability depends on your compiler's support for SFINAE.
<tr><td class="label"><a name="sfinae">[8]</a></td><td>This capability depends on your compiler's support for SFINAE.
<strong>SFINAE</strong>: <strong>S</strong>ubstitution <strong>F</strong>ailure <strong>I</strong>s
<strong>N</strong>ot <strong>A</strong>n <strong>E</strong>rror. If type substitution during the
<strong>N</strong>ot <strong>A</strong>n <strong>E</strong> rror. If type substitution during the
instantiation of a function template results in an invalid type,
no compilation error is emitted; instead the overload is removed
from the overload set. By producing an invalid type in the
@@ -2185,7 +2151,7 @@ information on SFINAE.</td></tr>
</div>
<div class="footer">
<hr class="footer" />
Generated on: 2007-05-03 14:12 UTC.
Generated on: 2007-01-03 17:02 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@@ -7,7 +7,7 @@
<title>The Boost Parameter Library Python Binding Documentation</title>
<meta name="authors" content="Daniel Wallin" />
<meta name="organization" content="Boost Consulting" />
<meta name="date" content="2006-12-14" />
<meta name="date" content="2006-09-21" />
<meta name="copyright" content="Copyright David Abrahams, Daniel Wallin 2005. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" />
<link rel="stylesheet" href="rst.css" type="text/css" />
</head>
@@ -25,7 +25,7 @@
<tr><th class="docinfo-name">Organization:</th>
<td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2006-12-14</td></tr>
<td>2006-09-21</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>Copyright David Abrahams, Daniel Wallin
2005. Distributed under the Boost Software License,
@@ -42,19 +42,19 @@ functions, operators and constructors to Python.</p>
<div class="contents topic">
<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
<ul class="simple">
<li><a class="reference" href="#introduction" id="id7" name="id7">Introduction</a></li>
<li><a class="reference" href="#tutorial" id="id8" name="id8">Tutorial</a></li>
<li><a class="reference" href="#concept-parameterspec" id="id9" name="id9">concept <span class="concept">ParameterSpec</span></a></li>
<li><a class="reference" href="#special-keywords" id="id10" name="id10"><em>special</em> keywords</a></li>
<li><a class="reference" href="#class-template-init" id="id11" name="id11">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></li>
<li><a class="reference" href="#class-template-call" id="id12" name="id12">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></li>
<li><a class="reference" href="#class-template-function" id="id13" name="id13">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></li>
<li><a class="reference" href="#function-template-def" id="id14" name="id14">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></li>
<li><a class="reference" href="#portability" id="id15" name="id15">Portability</a></li>
<li><a class="reference" href="#introduction" id="id8" name="id8">Introduction</a></li>
<li><a class="reference" href="#tutorial" id="id9" name="id9">Tutorial</a></li>
<li><a class="reference" href="#concept-parameterspec" id="id10" name="id10">concept <span class="concept">ParameterSpec</span></a></li>
<li><a class="reference" href="#special-keywords" id="id11" name="id11"><em>special</em> keywords</a></li>
<li><a class="reference" href="#class-template-init" id="id12" name="id12">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></li>
<li><a class="reference" href="#class-template-call" id="id13" name="id13">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></li>
<li><a class="reference" href="#class-template-function" id="id14" name="id14">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></li>
<li><a class="reference" href="#function-template-def" id="id15" name="id15">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></li>
<li><a class="reference" href="#portability" id="id16" name="id16">Portability</a></li>
</ul>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id7" id="introduction" name="introduction">Introduction</a></h1>
<h1><a class="toc-backref" href="#id8" id="introduction" name="introduction">Introduction</a></h1>
<p><tt class="docutils literal"><span class="pre">boost/parameter/python.hpp</span></tt> introduces a group of <a class="reference" href="../../../python/doc/v2/def_visitor.html"><tt class="docutils literal"><span class="pre">def_visitors</span></tt></a> that can
be used to easily expose Boost.Parameter-enabled member functions to Python with
Boost.Python. It also provides a function template <tt class="docutils literal"><span class="pre">def()</span></tt> that can be used
@@ -81,7 +81,7 @@ We will take a closer look at how this is done in the tutorial section below.</p
<!-- function? -->
</div>
<div class="section">
<h1><a class="toc-backref" href="#id8" id="tutorial" name="tutorial">Tutorial</a></h1>
<h1><a class="toc-backref" href="#id9" id="tutorial" name="tutorial">Tutorial</a></h1>
<p>In this section we will outline the steps needed to bind a simple
Boost.Parameter-enabled member function to Python. Knowledge of the
Boost.Parameter <a class="reference" href="index.html">macros</a> are required to understand this section.</p>
@@ -124,8 +124,7 @@ Python we use the binding utility <tt class="docutils literal"><span class="pre"
<tt class="docutils literal"><span class="pre">boost::parameter::python::function</span></tt> is a <a class="reference" href="../../../python/doc/v2/def_visitor.html"><tt class="docutils literal"><span class="pre">def_visitor</span></tt></a> that we'll instantiate
and pass to <tt class="docutils literal"><span class="pre">boost::python::class_::def()</span></tt>.</p>
<p>To use <tt class="docutils literal"><span class="pre">boost::parameter::python::function</span></tt> we first need to define
a class with forwarding overloads. This is needed because <tt class="docutils literal"><span class="pre">window::open()</span></tt>
is a function template, so we can't refer to it in any other way.</p>
a class with forwarding overloads.</p>
<pre class="literal-block">
struct open_fwd
{
@@ -189,9 +188,7 @@ forwarding overloads that we defined earlier. The second one is an <a class="ref
Sequence</a> with the keyword tag types and argument types for the function
specified as function types. The pointer syntax used in <tt class="docutils literal"><span class="pre">tag::width*</span></tt> and
<tt class="docutils literal"><span class="pre">tag::height*</span></tt> means that the parameter is optional. The first element of
the <a class="reference" href="../../../mpl/doc/refmanual/sequences.html">MPL Sequence</a> is the return type of the function, in this case <tt class="docutils literal"><span class="pre">void</span></tt>,
which is passed as the first argument to <tt class="docutils literal"><span class="pre">operator()</span></tt> in the forwarding
class.</p>
the <a class="reference" href="../../../mpl/doc/refmanual/sequences.html">MPL Sequence</a> is the return type of the function, in this case <tt class="docutils literal"><span class="pre">void</span></tt>.</p>
<!-- The
pointer syntax means that the parameter is optional, so in this case
``width`` and ``height`` are optional parameters. The third parameter
@@ -243,7 +240,7 @@ types instead). -->
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id9" id="concept-parameterspec" name="concept-parameterspec">concept <span class="concept">ParameterSpec</span></a></h1>
<h1><a class="toc-backref" href="#id10" id="concept-parameterspec" name="concept-parameterspec">concept <span class="concept">ParameterSpec</span></a></h1>
<p>A <span class="concept">ParameterSpec</span> is a function type <tt class="docutils literal"><span class="pre">K(T)</span></tt> that describes both the keyword tag,
<tt class="docutils literal"><span class="pre">K</span></tt>, and the argument type, <tt class="docutils literal"><span class="pre">T</span></tt>, for a parameter.</p>
<p><tt class="docutils literal"><span class="pre">K</span></tt> is either:</p>
@@ -264,12 +261,11 @@ the <strong>arity range</strong> of <tt class="docutils literal"><span class="pr
<strong>arity range</strong> of <tt class="docutils literal"><span class="pre">mpl::vector2&lt;x(int),y**(int)&gt;</span></tt> is <tt class="docutils literal"><span class="pre">[1,2]</span></tt>.</p>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id10" id="special-keywords" name="special-keywords"><em>special</em> keywords</a></h1>
<h1><a class="toc-backref" href="#id11" id="special-keywords" name="special-keywords"><em>special</em> keywords</a></h1>
<p>Sometimes it is desirable to have a default value for a parameter that differ
in type from the parameter. This technique is useful for doing simple tag-dispatching
based on the presence of a parameter. For example:</p>
<!-- An example_ of this is given in the Boost.Parameter
docs. The example uses a different technique, but could also have been written like this: -->
based on the presence of a parameter. An <a class="reference" href="index.html#dispatching-based-on-the-presence-of-a-default">example</a> of this is given in the Boost.Parameter
docs. The example uses a different technique, but could also have been written like this:</p>
<pre class="literal-block">
namespace core
{
@@ -317,21 +313,19 @@ int main()
depth_first_search(params()(color = 0));
}''') -->
<!-- @build() -->
<!-- .. _example: index.html#dispatching-based-on-the-presence-of-a-default -->
<p>In the above example the type of the default for <tt class="docutils literal"><span class="pre">color</span></tt> is <tt class="docutils literal"><span class="pre">mpl::false_</span></tt>, a
type that is distinct from any color map that the user might supply.</p>
<p>When binding the case outlined above, the default type for <tt class="docutils literal"><span class="pre">color</span></tt> will not
be convertible to the parameter type. Therefore we need to tag the <tt class="docutils literal"><span class="pre">color</span></tt>
keyword as a <em>special</em> keyword. This is done by specifying the tag as
<tt class="docutils literal"><span class="pre">tag::color**</span></tt> when binding the function (see <a class="reference" href="#concept-parameterspec">concept ParameterSpec</a> for
more details on the tagging). By doing this we tell the binding functions that
it needs to generate two overloads, one with the <tt class="docutils literal"><span class="pre">color</span></tt> parameter present
and one without. Had there been two <em>special</em> keywords, four overloads would
need to be generated. The number of generated overloads is equal to 2<sup>N</sup>, where <tt class="docutils literal"><span class="pre">N</span></tt> is the number of <em>special</em> keywords.</p>
keyword as a <em>special</em> keyword. By doing this we tell the binding functions
that it needs to generate two overloads, one with the <tt class="docutils literal"><span class="pre">color</span></tt> parameter
present and one without. Had there been two <em>special</em> keywords, four
overloads would need to be generated. The number of generated overloads is
equal to 2<sup>N</sup>, where <tt class="docutils literal"><span class="pre">N</span></tt> is the number of <em>special</em> keywords.</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id11" id="class-template-init" name="class-template-init">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></h1>
<h1><a class="toc-backref" href="#id12" id="class-template-init" name="class-template-init">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></h1>
<p>Defines a named parameter enabled constructor.</p>
<pre class="literal-block">
template &lt;class ParameterSpecs&gt;
@@ -354,7 +348,7 @@ model of <span class="concept">ParameterSpec</span>.</p>
<li><p class="first">For every <tt class="docutils literal"><span class="pre">N</span></tt> in <tt class="docutils literal"><span class="pre">[U,V]</span></tt>, where <tt class="docutils literal"><span class="pre">[U,V]</span></tt> is the <strong>arity
range</strong> of <tt class="docutils literal"><span class="pre">ParameterSpecs</span></tt>, <tt class="docutils literal"><span class="pre">Class</span></tt> must support these
expressions:</p>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<colgroup>
<col width="30%" />
<col width="17%" />
@@ -388,7 +382,7 @@ expressions:</p>
uses CallPolicies when creating the binding.</p>
</div>
<div class="section">
<h2><a id="example" name="example">Example</a></h2>
<h2><a id="id3" name="id3">Example</a></h2>
<pre class="literal-block">
#include &lt;boost/parameter/keyword.hpp&gt;
#include &lt;boost/parameter/preprocessor.hpp&gt;
@@ -447,7 +441,7 @@ assert(args[y | 1] == 1);
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id12" id="class-template-call" name="class-template-call">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></h1>
<h1><a class="toc-backref" href="#id13" id="class-template-call" name="class-template-call">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></h1>
<p>Defines a <tt class="docutils literal"><span class="pre">__call__</span></tt> operator, mapped to <tt class="docutils literal"><span class="pre">operator()</span></tt> in C++.</p>
<pre class="literal-block">
template &lt;class ParameterSpecs&gt;
@@ -470,7 +464,7 @@ is the result type of <tt class="docutils literal"><span class="pre">c(…)</spa
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">Class</span></tt> must support these expressions, where <tt class="docutils literal"><span class="pre">c</span></tt> is an
instance of <tt class="docutils literal"><span class="pre">Class</span></tt>:</p>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<colgroup>
<col width="24%" />
<col width="26%" />
@@ -500,12 +494,12 @@ instance of <tt class="docutils literal"><span class="pre">Class</span></tt>:</p
</ul>
</div>
<div class="section">
<h2><a id="id3" name="id3"><tt class="docutils literal"><span class="pre">template</span> <span class="pre">&lt;class</span> <span class="pre">CallPolicies&gt;</span> <span class="pre">operator[](CallPolicies</span> <span class="pre">const&amp;)</span></tt></a></h2>
<h2><a id="id4" name="id4"><tt class="docutils literal"><span class="pre">template</span> <span class="pre">&lt;class</span> <span class="pre">CallPolicies&gt;</span> <span class="pre">operator[](CallPolicies</span> <span class="pre">const&amp;)</span></tt></a></h2>
<p>Returns a <tt class="docutils literal"><span class="pre">def_visitor</span></tt> equivalent to <tt class="docutils literal"><span class="pre">*this</span></tt>, except that it
uses CallPolicies when creating the binding.</p>
</div>
<div class="section">
<h2><a id="id4" name="id4">Example</a></h2>
<h2><a id="id5" name="id5">Example</a></h2>
<pre class="literal-block">
#include &lt;boost/parameter/keyword.hpp&gt;
#include &lt;boost/parameter/preprocessor.hpp&gt;
@@ -574,7 +568,7 @@ return 0;
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id13" id="class-template-function" name="class-template-function">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></h1>
<h1><a class="toc-backref" href="#id14" id="class-template-function" name="class-template-function">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></h1>
<p>Defines a named parameter enabled member function.</p>
<pre class="literal-block">
template &lt;class Fwd, class ParameterSpecs&gt;
@@ -594,7 +588,7 @@ is the result type of <tt class="docutils literal"><span class="pre">c.f(…)</s
function.</p>
</li>
<li><p class="first">An instance of <tt class="docutils literal"><span class="pre">Fwd</span></tt> must support this expression:</p>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<colgroup>
<col width="39%" />
<col width="18%" />
@@ -626,7 +620,7 @@ are tagged arguments.</p>
</ul>
</div>
<div class="section">
<h2><a id="id5" name="id5">Example</a></h2>
<h2><a id="id6" name="id6">Example</a></h2>
<p>This example exports a member function <tt class="docutils literal"><span class="pre">f(int</span> <span class="pre">x,</span> <span class="pre">int</span> <span class="pre">y</span> <span class="pre">=</span> <span class="pre">…)</span></tt> to Python. The
sequence of <span class="concept">ParameterSpec</span>'s <tt class="docutils literal"><span class="pre">mpl::vector2&lt;tag::x(int),</span> <span class="pre">tag::y*(int)&gt;</span></tt> has
an <strong>arity range</strong> of [2,2], so we only need one forwarding overload.</p>
@@ -690,7 +684,7 @@ assert(y == 1);
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id14" id="function-template-def" name="function-template-def">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></h1>
<h1><a class="toc-backref" href="#id15" id="function-template-def" name="function-template-def">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></h1>
<p>Defines a named parameter enabled free function in the current Python scope.</p>
<pre class="literal-block">
template &lt;class Fwd, class ParameterSpecs&gt;
@@ -705,7 +699,7 @@ except the first models <span class="concept">ParameterSpec</span>. The first el
is the result type of <tt class="docutils literal"><span class="pre">f(…)</span></tt>, where <tt class="docutils literal"><span class="pre">f</span></tt> is the function.</p>
</li>
<li><p class="first">An instance of <tt class="docutils literal"><span class="pre">Fwd</span></tt> must support this expression:</p>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<colgroup>
<col width="39%" />
<col width="21%" />
@@ -735,7 +729,7 @@ is the result type of <tt class="docutils literal"><span class="pre">f(…)</spa
</ul>
</div>
<div class="section">
<h2><a id="id6" name="id6">Example</a></h2>
<h2><a id="id7" name="id7">Example</a></h2>
<p>This example exports a function <tt class="docutils literal"><span class="pre">f(int</span> <span class="pre">x,</span> <span class="pre">int</span> <span class="pre">y</span> <span class="pre">=</span> <span class="pre">…)</span></tt> to Python. The
sequence of <span class="concept">ParameterSpec</span>'s <tt class="docutils literal"><span class="pre">mpl::vector2&lt;tag::x(int),</span> <span class="pre">tag::y*(int)&gt;</span></tt> has
an <strong>arity range</strong> of [2,2], so we only need one forwarding overload.</p>
@@ -772,14 +766,14 @@ BOOST_PYTHON_MODULE(…)
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id15" id="portability" name="portability">Portability</a></h1>
<h1><a class="toc-backref" href="#id16" id="portability" name="portability">Portability</a></h1>
<p>The Boost.Parameter Python binding library requires <em>partial template
specialization</em>.</p>
</div>
</div>
<div class="footer">
<hr class="footer" />
Generated on: 2007-01-03 16:40 UTC.
Generated on: 2007-01-03 17:02 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@@ -39,73 +39,67 @@ or copy at <a class="reference" href="http://www.boost.org/LICENSE_1_0.txt">http
<div class="contents topic">
<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
<ul class="auto-toc simple">
<li><a class="reference" href="#preliminaries" id="id30" name="id30">1&nbsp;&nbsp;&nbsp;Preliminaries</a><ul class="auto-toc">
<li><a class="reference" href="#namespaces" id="id31" name="id31">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></li>
<li><a class="reference" href="#exceptions" id="id32" name="id32">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></li>
<li><a class="reference" href="#thread-safety" id="id33" name="id33">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></li>
<li><a class="reference" href="#typography" id="id34" name="id34">1.4&nbsp;&nbsp;&nbsp;Typography</a></li>
<li><a class="reference" href="#preliminaries" id="id26" name="id26">1&nbsp;&nbsp;&nbsp;Preliminaries</a><ul class="auto-toc">
<li><a class="reference" href="#namespaces" id="id27" name="id27">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></li>
<li><a class="reference" href="#exceptions" id="id28" name="id28">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></li>
<li><a class="reference" href="#thread-safety" id="id29" name="id29">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></li>
<li><a class="reference" href="#typography" id="id30" name="id30">1.4&nbsp;&nbsp;&nbsp;Typography</a></li>
</ul>
</li>
<li><a class="reference" href="#terminology" id="id35" name="id35">2&nbsp;&nbsp;&nbsp;Terminology</a></li>
<li><a class="reference" href="#concepts" id="id36" name="id36">3&nbsp;&nbsp;&nbsp;Concepts</a><ul class="auto-toc">
<li><a class="reference" href="#argumentpack" id="id37" name="id37">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></li>
<li><a class="reference" href="#id5" id="id38" name="id38">3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></li>
<li><a class="reference" href="#terminology" id="id31" name="id31">2&nbsp;&nbsp;&nbsp;Terminology</a></li>
<li><a class="reference" href="#concepts" id="id32" name="id32">3&nbsp;&nbsp;&nbsp;Concepts</a><ul class="auto-toc">
<li><a class="reference" href="#argumentpack" id="id33" name="id33">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></li>
<li><a class="reference" href="#id5" id="id34" name="id34">3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></li>
</ul>
</li>
<li><a class="reference" href="#class-templates" id="id39" name="id39">4&nbsp;&nbsp;&nbsp;Class Templates</a><ul class="auto-toc">
<li><a class="reference" href="#id7" id="id40" name="id40">4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">keyword</span></tt></a></li>
<li><a class="reference" href="#parameters" id="id41" name="id41">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">parameters</span></tt></a></li>
<li><a class="reference" href="#optional-required" id="id42" name="id42">4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">optional</span></tt>, <tt class="docutils literal"><span class="pre">required</span></tt></a></li>
<li><a class="reference" href="#deduced" id="id43" name="id43">4.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">deduced</span></tt></a></li>
<li><a class="reference" href="#class-templates" id="id35" name="id35">4&nbsp;&nbsp;&nbsp;Class Templates</a><ul class="auto-toc">
<li><a class="reference" href="#id7" id="id36" name="id36">4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">keyword</span></tt></a></li>
<li><a class="reference" href="#parameters" id="id37" name="id37">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">parameters</span></tt></a></li>
<li><a class="reference" href="#optional-required" id="id38" name="id38">4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">optional</span></tt>, <tt class="docutils literal"><span class="pre">required</span></tt></a></li>
</ul>
</li>
<li><a class="reference" href="#metafunctions" id="id44" name="id44">5&nbsp;&nbsp;&nbsp;Metafunctions</a><ul class="auto-toc">
<li><a class="reference" href="#binding" id="id45" name="id45">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">binding</span></tt></a></li>
<li><a class="reference" href="#lazy-binding" id="id46" name="id46">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">lazy_binding</span></tt></a></li>
<li><a class="reference" href="#value-type" id="id47" name="id47">5.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">value_type</span></tt></a></li>
<li><a class="reference" href="#metafunctions" id="id39" name="id39">5&nbsp;&nbsp;&nbsp;Metafunctions</a><ul class="auto-toc">
<li><a class="reference" href="#binding" id="id40" name="id40">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">binding</span></tt></a></li>
<li><a class="reference" href="#lazy-binding" id="id41" name="id41">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">lazy_binding</span></tt></a></li>
</ul>
</li>
<li><a class="reference" href="#code-generation-macros" id="id48" name="id48">6&nbsp;&nbsp;&nbsp;Code Generation Macros</a><ul class="auto-toc">
<li><a class="reference" href="#boost-parameter-function-result-name-tag-namespace-arguments" id="id49" name="id49">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-member-function-result-name-tag-namespace-arguments" id="id50" name="id50">6.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MEMBER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-constructor-cls-impl-tag-namespace-arguments" id="id51" name="id51">6.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_CONSTRUCTOR(cls,</span> <span class="pre">impl,</span> <span class="pre">tag_namespace,</span> <span class="pre">arguments)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-name-name" id="id52" name="id52">6.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_NAME(name)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-template-keyword-name" id="id53" name="id53">6.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_TEMPLATE_KEYWORD(name)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-fun-r-n-l-h-p" id="id54" name="id54">6.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUN(r,n,l,h,p)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-keyword-n-k" id="id55" name="id55">6.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_KEYWORD(n,k)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-match-p-a-x" id="id56" name="id56">6.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MATCH(p,a,x)</span></tt></a></li>
<li><a class="reference" href="#code-generation-macros" id="id42" name="id42">6&nbsp;&nbsp;&nbsp;Code Generation Macros</a><ul class="auto-toc">
<li><a class="reference" href="#boost-parameter-function-result-name-tag-namespace-arguments" id="id43" name="id43">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-fun-r-n-l-h-p" id="id44" name="id44">6.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUN(r,n,l,h,p)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-keyword-n-k" id="id45" name="id45">6.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_KEYWORD(n,k)</span></tt></a></li>
<li><a class="reference" href="#boost-parameter-match-p-a-x" id="id46" name="id46">6.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MATCH(p,a,x)</span></tt></a></li>
</ul>
</li>
<li><a class="reference" href="#configuration-macros" id="id57" name="id57">7&nbsp;&nbsp;&nbsp;Configuration Macros</a><ul class="auto-toc">
<li><a class="reference" href="#boost-parameter-max-arity" id="id58" name="id58">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MAX_ARITY</span></tt></a></li>
<li><a class="reference" href="#configuration-macros" id="id47" name="id47">7&nbsp;&nbsp;&nbsp;Configuration Macros</a><ul class="auto-toc">
<li><a class="reference" href="#boost-parameter-max-arity" id="id48" name="id48">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MAX_ARITY</span></tt></a></li>
</ul>
</li>
<li><a class="reference" href="#tutorial" id="id59" name="id59">8&nbsp;&nbsp;&nbsp;Tutorial</a></li>
<li><a class="reference" href="#tutorial" id="id49" name="id49">8&nbsp;&nbsp;&nbsp;Tutorial</a></li>
</ul>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id30" id="preliminaries" name="preliminaries">1&nbsp;&nbsp;&nbsp;Preliminaries</a></h1>
<h1><a class="toc-backref" href="#id26" id="preliminaries" name="preliminaries">1&nbsp;&nbsp;&nbsp;Preliminaries</a></h1>
<p>This section covers some basic information you'll need to know in
order to understand this reference</p>
<div class="section">
<h2><a class="toc-backref" href="#id31" id="namespaces" name="namespaces">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></h2>
<h2><a class="toc-backref" href="#id27" id="namespaces" name="namespaces">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></h2>
<p>In this document, all unqualified identifiers should be assumed to
be defined in namespace <tt class="docutils literal"><span class="pre">boost::parameter</span></tt> unless otherwise
specified.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id32" id="exceptions" name="exceptions">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></h2>
<h2><a class="toc-backref" href="#id28" id="exceptions" name="exceptions">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></h2>
<p>No operation described in this document
throws an exception unless otherwise specified.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id33" id="thread-safety" name="thread-safety">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></h2>
<h2><a class="toc-backref" href="#id29" id="thread-safety" name="thread-safety">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></h2>
<p>All components of this library can be used safely from multiple
threads without synchronization.<a class="footnote-reference" href="#thread" id="id2" name="id2"><sup>1</sup></a></p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id34" id="typography" name="typography">1.4&nbsp;&nbsp;&nbsp;Typography</a></h2>
<h2><a class="toc-backref" href="#id30" id="typography" name="typography">1.4&nbsp;&nbsp;&nbsp;Typography</a></h2>
<p>Names written in <span class="concept">sans serif type</span> represent <a class="reference" href="../../../../more/generic_programming.html#concept">concepts</a>.</p>
<p>In code blocks, <em>italic type</em> represents unspecified text that
satisfies the requirements given in the detailed description that
@@ -118,7 +112,7 @@ argument in the result.</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id35" id="terminology" name="terminology">2&nbsp;&nbsp;&nbsp;Terminology</a></h1>
<h1><a class="toc-backref" href="#id31" id="terminology" name="terminology">2&nbsp;&nbsp;&nbsp;Terminology</a></h1>
<dl class="docutils" id="kw">
<dt>keyword</dt>
<dd>The name of a function parameter.</dd>
@@ -177,10 +171,10 @@ models <a class="reference" href="#argumentpack"><span class="concept">ArgumentP
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id36" id="concepts" name="concepts">3&nbsp;&nbsp;&nbsp;Concepts</a></h1>
<h1><a class="toc-backref" href="#id32" id="concepts" name="concepts">3&nbsp;&nbsp;&nbsp;Concepts</a></h1>
<p>This section describes the generic type <a class="reference" href="../../../../more/generic_programming.html#concept">concepts</a> used by the Parameter library.</p>
<div class="section">
<h2><a class="toc-backref" href="#id37" id="argumentpack" name="argumentpack">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></h2>
<h2><a class="toc-backref" href="#id33" id="argumentpack" name="argumentpack">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></h2>
<p>An <span class="concept">ArgumentPack</span> is a collection of <a class="reference" href="#tagged-reference">tagged reference</a>s to the
actual arguments passed to a function. Every <span class="concept">ArgumentPack</span> is
also a valid MPL <a class="reference" href="../../../mpl/doc/refmanual/forward-sequence.html"><span class="concept">Forward Sequence</span></a> consisting of the <a class="reference" href="#keyword-tag-type">keyword tag type</a>s in its <a class="reference" href="#tagged-reference">tagged reference</a>s.</p>
@@ -197,7 +191,7 @@ also a valid MPL <a class="reference" href="../../../mpl/doc/refmanual/forward-s
</ul>
<p>Any exceptions are thrown from the invocation of <tt class="docutils literal"><span class="pre">w</span></tt>'s <em>value</em>
will be propagated to the caller.</p>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<caption><span class="concept">ArgumentPack</span> requirements</caption>
<colgroup>
<col width="11%" />
@@ -249,7 +243,7 @@ all the elements of both <tt class="docutils literal"><span class="pre">x</span>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id38" id="id5" name="id5"><span id="parameterspec"></span>3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></h2>
<h2><a class="toc-backref" href="#id34" id="id5" name="id5"><span id="parameterspec"></span>3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></h2>
<p>A <span class="concept">ParameterSpec</span> describes the type requirements for arguments
corresponding to a given <a class="reference" href="#kw">keyword</a> and indicates whether the argument
is optional or required. The table below details the allowed forms
@@ -260,7 +254,7 @@ argument type. In each row,</p>
<li><tt class="docutils literal"><span class="pre">A</span></tt> is an <a class="reference" href="#intended-argument-type">intended argument type</a> associated with <tt class="docutils literal"><span class="pre">K</span></tt>, if any</li>
<li><tt class="docutils literal"><span class="pre">F</span></tt> is a unary <a class="reference" href="../../../mpl/doc/refmanual/lambda-expression.html">MPL lambda expression</a></li>
</ul>
<table border="1" class="docutils">
<table border="1" class="docutils table">
<caption><span class="concept">ParameterSpec</span> allowed forms and conditions of satisfaction</caption>
<colgroup>
<col width="32%" />
@@ -274,7 +268,7 @@ argument type. In each row,</p>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">K</span></tt></td>
<tr><td><a class="reference" href="#keyword"><tt class="docutils literal"><span class="pre">keyword</span></tt></a><tt class="docutils literal"><span class="pre">&lt;K&gt;</span></tt></td>
<td>no</td>
<td><em>n/a</em></td>
</tr>
@@ -296,9 +290,9 @@ arguments that will be matched by <a class="reference" href="index.html#forwardi
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id39" id="class-templates" name="class-templates">4&nbsp;&nbsp;&nbsp;Class Templates</a></h1>
<h1><a class="toc-backref" href="#id35" id="class-templates" name="class-templates">4&nbsp;&nbsp;&nbsp;Class Templates</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id40" id="id7" name="id7"><span id="keyword"></span>4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">keyword</span></tt></a></h2>
<h2><a class="toc-backref" href="#id36" id="id7" name="id7"><span id="keyword"></span>4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">keyword</span></tt></a></h2>
<p>The type of every <a class="reference" href="#keyword-object">keyword object</a> is a specialization of <tt class="docutils literal"><span class="pre">keyword</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@@ -396,7 +390,7 @@ simultaneously.</td>
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id41" id="parameters" name="parameters">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">parameters</span></tt></a></h2>
<h2><a class="toc-backref" href="#id37" id="parameters" name="parameters">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">parameters</span></tt></a></h2>
<p>Provides an interface for assembling the actual arguments to a
<cite>forwarding function</cite> into an <span class="concept">ArgumentPack</span>, in which any
<a class="reference" href="#positional">positional</a> arguments will be tagged according to the
@@ -420,15 +414,15 @@ struct parameters
};
template &lt;class A0&gt;
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0&amp; a0) const;
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0 const&amp; a0) const;
template &lt;class A0, class A1&gt;
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0&amp; a0, A1&amp; a1) const;
<span class="vellipsis"></span>
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0 const&amp; a0, A1 const&amp; a1) const; <span class="vellipsis"> .
.
.
</span>
template &lt;class A0, class A1, …class Aβ&gt;
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0&amp; a0, A1&amp; a1, …Aβ&amp; aβ) const;
<a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0 const&amp; a0, A1 const&amp; a1, …Aβ const&amp; aβ) const;
};
</pre>
<table class="docutils field-list" frame="void" rules="none">
@@ -445,9 +439,9 @@ struct parameters
follows, for any argument type <tt class="docutils literal"><span class="pre">A</span></tt><em>i</em>:</p>
<blockquote class="last">
<div class="line-block">
<div class="line">let <tt class="docutils literal"><span class="pre">D0</span></tt> the set [d0, …, d<em>j</em>] of all <strong>deduced</strong> <em>parameter specs</em> in [<tt class="docutils literal"><span class="pre">P0</span></tt>, …, <tt class="docutils literal"><span class="pre">P</span></tt>β]</div>
<div class="line"><tt class="docutils literal"><span class="pre">R</span></tt><em>i</em> is <tt class="docutils literal"><span class="pre">A</span></tt><em>i</em>'s <a class="reference" href="#intended-argument-type">intended argument type</a></div>
<div class="line"><br /></div>
<div class="line-block">
<div class="line">if <tt class="docutils literal"><span class="pre">A</span></tt><em>i</em> is a result type of <tt class="docutils literal"><span class="pre">keyword&lt;T&gt;::</span></tt><a class="reference" href="#operator"><tt class="docutils literal"><span class="pre">operator=</span></tt></a></div>
<div class="line">then</div>
<div class="line-block">
@@ -455,19 +449,6 @@ follows, for any argument type <tt class="docutils literal"><span class="pre">A<
</div>
<div class="line">else</div>
<div class="line-block">
<div class="line">if some <tt class="docutils literal"><span class="pre">A</span></tt><em>j</em> where <em>j</em><em>i</em> is a result type of <tt class="docutils literal"><span class="pre">keyword&lt;T&gt;::</span></tt><a class="reference" href="#operator"><tt class="docutils literal"><span class="pre">operator=</span></tt></a></div>
<div class="line"><em>or</em> some <tt class="docutils literal"><span class="pre">P</span></tt><em>j</em> in <em>j</em><em>i</em> is <strong>deduced</strong></div>
<div class="line">then</div>
<div class="line-block">
<div class="line">if some <em>parameter spec</em> <tt class="docutils literal"><span class="pre">d</span></tt><em>j</em> in <tt class="docutils literal"><span class="pre">D</span></tt><em>i</em> matches <tt class="docutils literal"><span class="pre">A</span></tt><em>i</em></div>
<div class="line">then</div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">K</span></tt><em>i</em> is <tt class="docutils literal"><span class="pre">d</span></tt><em>j</em>'s <a class="reference" href="#keyword-tag-type">keyword tag type</a>.</div>
<div class="line"><tt class="docutils literal"><span class="pre">D</span></tt><sub>i+1</sub> is <tt class="docutils literal"><span class="pre">D</span></tt><em>i</em> - [<tt class="docutils literal"><span class="pre">d</span></tt><em>j</em>]</div>
</div>
</div>
<div class="line">else</div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">K</span></tt><em>i</em> is <tt class="docutils literal"><span class="pre">P</span></tt><em>i</em>'s <a class="reference" href="#keyword-tag-type">keyword tag type</a>.</div>
</div>
</div>
@@ -491,7 +472,7 @@ below), then <tt class="docutils literal"><span class="pre">parameters&lt;P0,P1,
every <em>j</em> in 0…β, either:</p>
<ul class="last simple">
<li><tt class="docutils literal"><span class="pre">P</span></tt><em>j</em> is the <em>unspecified</em> default</li>
<li><strong>or</strong>, <tt class="docutils literal"><span class="pre">P</span></tt><em>j</em> is a <em>keyword tag type</em></li>
<li><strong>or</strong>, <tt class="docutils literal"><span class="pre">P</span></tt><em>j</em> is a specialization of <a class="reference" href="#keyword"><tt class="docutils literal"><span class="pre">keyword</span></tt></a>,</li>
<li><strong>or</strong>, <tt class="docutils literal"><span class="pre">P</span></tt><em>j</em> is <a class="reference" href="#optional"><tt class="docutils literal"><span class="pre">optional</span></tt></a> <tt class="docutils literal"><span class="pre">&lt;X,F&gt;</span></tt> and either<ul>
<li><tt class="docutils literal"><span class="pre">X</span></tt> is not <tt class="docutils literal"><span class="pre">K</span></tt><em>i</em> for any <em>i</em>,</li>
<li><strong>or</strong> <tt class="docutils literal"><span class="pre">X</span></tt> is some <tt class="docutils literal"><span class="pre">K</span></tt><em>i</em> and <tt class="docutils literal"><span class="pre">mpl::apply&lt;F,R</span></tt><em>i</em><tt class="docutils literal"><span class="pre">&gt;::type::value</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt></li>
@@ -508,10 +489,10 @@ every <em>j</em> in 0…β, either:</p>
<dl class="docutils" id="id13">
<dt><tt class="docutils literal"><span class="pre">operator()</span></tt></dt>
<dd><pre class="first literal-block">
template &lt;class A0&gt; <a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator()(A0 const&amp; a0) const;
<span class="vellipsis"></span>
template &lt;class A0&gt; <a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator()(A0 const&amp; a0) const; <span class="vellipsis"> .
.
.
</span>
template &lt;class A0, …class Aβ&gt; <a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference" href="#id13">operator()</a>(A0 const&amp; a0, …Aβ const&amp; aβ) const;
</pre>
<table class="last docutils field-list" frame="void" rules="none">
@@ -531,7 +512,7 @@ template &lt;class A0, …class Aβ&gt; <a class="reference" href="#argumentpack
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id42" id="optional-required" name="optional-required"><span id="required"></span><span id="optional"></span>4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">optional</span></tt>, <tt class="docutils literal"><span class="pre">required</span></tt></a></h2>
<h2><a class="toc-backref" href="#id38" id="optional-required" name="optional-required"><span id="required"></span><span id="optional"></span>4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">optional</span></tt>, <tt class="docutils literal"><span class="pre">required</span></tt></a></h2>
<p>These templates describe the requirements on a function parameter.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@@ -560,31 +541,14 @@ struct required;
<p>The default value of <tt class="docutils literal"><span class="pre">Predicate</span></tt> is an unspecified <a class="reference" href="../../../mpl/doc/refmanual/metafunction.html"><span class="concept">Metafunction</span></a> that returns
<tt class="docutils literal"><span class="pre">mpl::true_</span></tt> for any argument.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id43" id="deduced" name="deduced">4.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">deduced</span></tt></a></h2>
<p>This template is used to wrap the <em>keyword tag</em> argument to
<tt class="docutils literal"><span class="pre">optional</span></tt> or <tt class="docutils literal"><span class="pre">required</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference" href="../../../../boost/parameter/parameters.hpp">boost/parameter/parameters.hpp</a></td>
</tr>
</tbody>
</table>
<pre class="literal-block">
template &lt;class Tag&gt;
struct deduced;
</pre>
</div>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id44" id="metafunctions" name="metafunctions">5&nbsp;&nbsp;&nbsp;Metafunctions</a></h1>
<h1><a class="toc-backref" href="#id39" id="metafunctions" name="metafunctions">5&nbsp;&nbsp;&nbsp;Metafunctions</a></h1>
<p>A <a class="reference" href="../../../mpl/doc/refmanual/metafunction.html"><span class="concept">Metafunction</span></a> is conceptually a function that operates on, and
returns, C++ types.</p>
<div class="section">
<h2><a class="toc-backref" href="#id45" id="binding" name="binding">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">binding</span></tt></a></h2>
<h2><a class="toc-backref" href="#id40" id="binding" name="binding">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">binding</span></tt></a></h2>
<p>Returns the result type of indexing an argument pack with a
<a class="reference" href="#keyword-tag-type">keyword tag type</a> or with a <a class="reference" href="#tagged-default">tagged default</a>.</p>
<table class="docutils field-list" frame="void" rules="none">
@@ -615,7 +579,7 @@ having <a class="reference" href="#keyword-tag-type">keyword tag type</a> <tt cl
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id46" id="lazy-binding" name="lazy-binding">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">lazy_binding</span></tt></a></h2>
<h2><a class="toc-backref" href="#id41" id="lazy-binding" name="lazy-binding">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">lazy_binding</span></tt></a></h2>
<p>Returns the result type of indexing an argument pack with a <a class="reference" href="#tagged-lazy-default">tagged lazy default</a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@@ -639,46 +603,7 @@ struct lazy_binding
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal"><span class="pre">A</span></tt> is a model of <a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">the reference type of the <a class="reference" href="#tagged-reference">tagged reference</a> in <tt class="docutils literal"><span class="pre">A</span></tt>
having <a class="reference" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal"><span class="pre">K</span></tt>, if any. If no such <a class="reference" href="#tagged-reference">tagged reference</a> exists, returns <tt class="docutils literal"><span class="pre">boost::</span></tt><a class="reference" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">result_of</span></tt></a><tt class="docutils literal"><span class="pre">&lt;F()&gt;::type</span></tt>.<a class="footnote-reference" href="#no-result-of" id="id18" name="id18"><sup>2</sup></a></td>
</tr>
</tbody>
</table>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id47" id="value-type" name="value-type">5.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">value_type</span></tt></a></h2>
<p>Returns the result type of indexing an argument pack with a
<a class="reference" href="#keyword-tag-type">keyword tag type</a> or with a <a class="reference" href="#tagged-default">tagged default</a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined n:</th><td class="field-body"><a class="reference" href="../../../../boost/parameter/value_type.hpp">boost/parameter/value_type.hpp</a></td>
</tr>
</tbody>
</table>
<pre class="literal-block">
template &lt;class A, class K, class D = void&gt;
struct value_type
{
typedef … type;
};
</pre>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><p class="first"><tt class="docutils literal"><span class="pre">A</span></tt> is a model of <a class="reference" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the type of the <a class="reference" href="#tagged-reference">tagged reference</a> in <tt class="docutils literal"><span class="pre">A</span></tt>
having <a class="reference" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal"><span class="pre">K</span></tt>, if any. If no such <a class="reference" href="#tagged-reference">tagged reference</a> exists, returns <tt class="docutils literal"><span class="pre">D</span></tt>. Equivalent to:</p>
<pre class="literal-block">
typename remove_reference&lt;
typename binding&lt;A, K, D&gt;::type
&gt;::type
</pre>
<p class="last">… when <tt class="docutils literal"><span class="pre">D</span></tt> is not a reference type.</p>
</td>
having <a class="reference" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal"><span class="pre">K</span></tt>, if any. If no such <a class="reference" href="#tagged-reference">tagged reference</a> exists, returns <tt class="docutils literal"><span class="pre">boost::</span></tt><a class="reference" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">result_of</span></tt></a><tt class="docutils literal"><span class="pre">&lt;F()&gt;::type</span></tt>.<a class="footnote-reference" href="#no-result-of" id="id17" name="id17"><sup>2</sup></a></td>
</tr>
</tbody>
</table>
@@ -686,11 +611,11 @@ typename remove_reference&lt;
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id48" id="code-generation-macros" name="code-generation-macros">6&nbsp;&nbsp;&nbsp;Code Generation Macros</a></h1>
<h1><a class="toc-backref" href="#id42" id="code-generation-macros" name="code-generation-macros">6&nbsp;&nbsp;&nbsp;Code Generation Macros</a></h1>
<p>Macros in this section can be used to ease the writing of code
using the Parameter libray by eliminating repetitive boilerplate.</p>
<div class="section">
<h2><a class="toc-backref" href="#id49" id="boost-parameter-function-result-name-tag-namespace-arguments" name="boost-parameter-function-result-name-tag-namespace-arguments">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></h2>
<h2><a class="toc-backref" href="#id43" id="boost-parameter-function-result-name-tag-namespace-arguments" name="boost-parameter-function-result-name-tag-namespace-arguments">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
@@ -712,20 +637,17 @@ a list of <em>argument specifiers</em>, as defined below.</p>
</tr>
<tr class="field"><th class="field-name" colspan="2">Argument specifiers syntax:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><pre class="first literal-block">
argument-specifiers ::= <em>specifier-group</em> {<em>specifier-group</em>}
argument-specifiers ::= specifier-group {specifier-group}
specifier-group0 ::= <em>specifier-group1</em> |
( '<strong>(</strong>' '<strong>deduced</strong>' <em>specifier-group1</em> {<em>specifier-group1</em>} '<strong>)</strong>' )
specifier-group ::= ( '(' 'optional' optional-specifier {optional-specifier} ')' ) |
( '(' 'required' required-specifier {required-specifier} ')' )
specifier-group1 ::= ( '<strong>(</strong>' '<strong>optional</strong>' <em>optional-specifier</em> {<em>optional-specifier</em>} '<strong>)</strong>' ) |
( '<strong>(</strong>' '<strong>required</strong>' <em>required-specifier</em> {<em>required-specifier</em>} '<strong>)</strong>' )
optional-specifier ::= '(' name ',' restriction ',' default-value ')'
required-specifier ::= '(' name ',' restriction ')'
optional-specifier ::= '<strong>(</strong>' <em>name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em> ')'
required-specifier ::= '<strong>(</strong>' <em>name</em> '<strong>,</strong>' <em>restriction</em> ')'
restriction ::= ('<strong>*</strong>' '<strong>(</strong>' <em>lambda-expression</em> '<strong>)</strong>' ) |
( '<strong>(</strong>' <em>typename</em> '<strong>)</strong>' ) |
'<strong>*</strong>'
restriction ::= ('*' '(' lambda-expression ')' ) |
( '(' typename ')' ) |
'*'
</pre>
<p class="last"><tt class="docutils literal"><span class="pre">name</span></tt> is any valid C++ identifier. <tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid
C++ expression. <tt class="docutils literal"><span class="pre">typename</span></tt> is the name of a type.
@@ -784,7 +706,10 @@ template &lt;class A0, …, class A<strong>n</strong>&gt;
<em>… forward to implementation …</em>
}
<span class="vellipsis"></span>
<span class="vellipsis"> .
.
.
</span>
template &lt;class A0, …, class A<strong>m</strong>&gt;
<em>result type</em> <strong>name</strong>(
@@ -814,149 +739,7 @@ ResultType boost_param_default_ ## __LINE__ ## <strong>name</strong>(
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id50" id="boost-parameter-member-function-result-name-tag-namespace-arguments" name="boost-parameter-member-function-result-name-tag-namespace-arguments">6.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MEMBER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
</tr>
</tbody>
</table>
<p>See <tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt></p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id51" id="boost-parameter-constructor-cls-impl-tag-namespace-arguments" name="boost-parameter-constructor-cls-impl-tag-namespace-arguments">6.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_CONSTRUCTOR(cls,</span> <span class="pre">impl,</span> <span class="pre">tag_namespace,</span> <span class="pre">arguments)</span></tt></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
</tr>
</tbody>
</table>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><p class="first"><tt class="docutils literal"><span class="pre">cls</span></tt> is the name of this class. <tt class="docutils literal"><span class="pre">impl</span></tt> is the
parenthesized implementation base class for <tt class="docutils literal"><span class="pre">cls</span></tt>.
<tt class="docutils literal"><span class="pre">tag_namespace</span></tt> is the namespace in which the keywords
used by the function resides. <tt class="docutils literal"><span class="pre">arguments</span></tt> is
a list of <em>argument specifiers</em>, as defined in
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)</span></tt>.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Generated names in enclosing scope:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><ul class="first last simple">
<li><tt class="docutils literal"><span class="pre">boost_param_params_</span> <span class="pre">##</span> <span class="pre">__LINE__</span> <span class="pre">##</span> <span class="pre">ctor</span></tt></li>
<li><tt class="docutils literal"><span class="pre">constructor_parameters</span> <span class="pre">##</span> <span class="pre">__LINE__</span></tt></li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="docutils">
<dt>Approximate expansion:</dt>
<dd><p class="first"><strong>Where</strong>:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">n</span></tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal"><span class="pre">arguments</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">m</span></tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal"><span class="pre">arguments</span></tt>.</li>
</ul>
<pre class="last literal-block">
struct boost_param_params_ ## __LINE__ ## ctor
: boost::parameter::parameters&lt;
<em>list of parameter specifications, based on arguments</em>
&gt;
{};
typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
constructor_parameters ## __LINE__;
template &lt;class A0, …, class A<strong>n</strong>&gt;
<em>cls</em>(A0 const&amp; a0, …, A<strong>n</strong> const&amp; a<strong>n</strong>)
: <em>impl</em>(constructor_parameters ## __LINE__(a0, …, a<strong>n</strong>))
{}
<span class="vellipsis"></span>
template &lt;class A0, …, class A<strong>m</strong>&gt;
<em>cls</em>(A0 const&amp; a0, …, A<strong>n</strong> const&amp; a<strong>m</strong>)
: <em>impl</em>(constructor_parameters ## __LINE__(a0, …, a<strong>m</strong>))
{}
</pre>
</dd>
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id52" id="boost-parameter-name-name" name="boost-parameter-name-name">6.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_NAME(name)</span></tt></a></h2>
<p>Declares a tag-type and keyword object.</p>
<p>Expands to:</p>
<p><strong>If</strong> <em>name</em> is of the form:</p>
<pre class="literal-block">
(<em>tag-name</em>, <em>namespace-name</em>) <em>object-name</em>
</pre>
<p><strong>then</strong></p>
<pre class="literal-block">
namespace <em>namespace-name</em>
{
struct <em>tag-name</em>
{
static char const* keyword_name()
{
return ##<em>tag-name</em>;
}
typedef <em>implementation defined</em> _;
typedef <em>implementation defined</em> _1;
};
}
::boost::parameter::keyword&lt;<em>tag-namespace</em>::<em>tag-name</em>&gt; const&amp; <em>object-name</em>
= ::boost::parameter::keyword&lt;<em>tag-namespace</em>::<em>tag-name</em>&gt;::instance;
</pre>
<p><strong>Else</strong></p>
<pre class="literal-block">
namespace tag
{
struct <em>name</em>
{
static char const* keyword_name()
{
return ##<em>name</em>;
}
typedef <em>implementation defined</em> _;
typedef <em>implementation defined</em> _1;
};
}
::boost::parameter::keyword&lt;tag::<em>name</em>&gt; const&amp; _<em>name</em>
= ::boost::parameter::keyword&lt;tag::<em>name</em>&gt;::instance;
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id53" id="boost-parameter-template-keyword-name" name="boost-parameter-template-keyword-name">6.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_TEMPLATE_KEYWORD(name)</span></tt></a></h2>
<p>Expands to:</p>
<pre class="literal-block">
namespace tag
{
struct <em>name</em>;
}
template &lt;class T&gt;
struct <em>name</em>
: ::boost::parameter::template_keyword&lt;tag::<em>name</em>, T&gt;
{};
</pre>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id54" id="boost-parameter-fun-r-n-l-h-p" name="boost-parameter-fun-r-n-l-h-p">6.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUN(r,n,l,h,p)</span></tt></a></h2>
<div class="admonition-deprecated admonition">
<p class="first admonition-title">Deprecated</p>
<p class="last">This macro has been deprecated in favor of
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUNCTION</span></tt>.</p>
</div>
<h2><a class="toc-backref" href="#id44" id="boost-parameter-fun-r-n-l-h-p" name="boost-parameter-fun-r-n-l-h-p">6.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_FUN(r,n,l,h,p)</span></tt></a></h2>
<p>Generates a sequence of <a class="reference" href="index.html#forwarding-functions">forwarding function</a> templates named
<tt class="docutils literal"><span class="pre">n</span></tt>, with arities ranging from <tt class="docutils literal"><span class="pre">l</span></tt> to <tt class="docutils literal"><span class="pre">h</span></tt> , returning <tt class="docutils literal"><span class="pre">r</span></tt>,
and using <tt class="docutils literal"><span class="pre">p</span></tt> to control overload resolution and assign tags to
@@ -996,10 +779,10 @@ r name(
, typename <strong>p</strong>::match&lt;A1,A2,…A<strong>l</strong>,A##<a class="reference" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)&gt;::type p = <strong>p</strong>())
{
return <strong>name</strong>_with_named_params(<strong>p</strong>(x1,x2,…x<strong>l</strong>,x##<a class="reference" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)));
}
<span class="vellipsis"></span>
} <span class="vellipsis"> .
.
.
</span>
template &lt;class A1, class A2, …class A<strong>h</strong>&gt;
r name(
A1 const&amp; a1, A2 const&amp; a2, …A<strong>h</strong> const&amp; x<strong>h</strong>
@@ -1012,12 +795,7 @@ r name(
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id55" id="boost-parameter-keyword-n-k" name="boost-parameter-keyword-n-k">6.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_KEYWORD(n,k)</span></tt></a></h2>
<div class="admonition-deprecated admonition">
<p class="first admonition-title">Deprecated</p>
<p class="last">This macro has been deprecated in favor of
<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_NAME</span></tt>.</p>
</div>
<h2><a class="toc-backref" href="#id45" id="boost-parameter-keyword-n-k" name="boost-parameter-keyword-n-k">6.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_KEYWORD(n,k)</span></tt></a></h2>
<p>Generates the declaration of a <a class="reference" href="#keyword-tag-type">keyword tag type</a> named <tt class="docutils literal"><span class="pre">k</span></tt> in
namespace <tt class="docutils literal"><span class="pre">n</span></tt>, and a corresponding <a class="reference" href="#keyword-object">keyword object</a> definition in
the enclosing namespace.</p>
@@ -1042,7 +820,7 @@ namespace {
</dl>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id56" id="boost-parameter-match-p-a-x" name="boost-parameter-match-p-a-x">6.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MATCH(p,a,x)</span></tt></a></h2>
<h2><a class="toc-backref" href="#id46" id="boost-parameter-match-p-a-x" name="boost-parameter-match-p-a-x">6.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MATCH(p,a,x)</span></tt></a></h2>
<p>Generates a defaulted parameter declaration for a <a class="reference" href="index.html#forwarding-functions">forwarding
function</a>.</p>
<table class="docutils field-list" frame="void" rules="none">
@@ -1076,9 +854,9 @@ typename <strong>p</strong>::match&lt;<strong>A0</strong>,<strong>A1</strong>…
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id57" id="configuration-macros" name="configuration-macros">7&nbsp;&nbsp;&nbsp;Configuration Macros</a></h1>
<h1><a class="toc-backref" href="#id47" id="configuration-macros" name="configuration-macros">7&nbsp;&nbsp;&nbsp;Configuration Macros</a></h1>
<div class="section">
<h2><a class="toc-backref" href="#id58" id="boost-parameter-max-arity" name="boost-parameter-max-arity">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MAX_ARITY</span></tt></a></h2>
<h2><a class="toc-backref" href="#id48" id="boost-parameter-max-arity" name="boost-parameter-max-arity">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">BOOST_PARAMETER_MAX_ARITY</span></tt></a></h2>
<p>Determines the maximum number of arguments supported by the
library. Will only be <tt class="docutils literal"><span class="pre">#defined</span></tt> by the library if it is not
already <tt class="docutils literal"><span class="pre">#defined</span></tt>.</p>
@@ -1101,7 +879,7 @@ already <tt class="docutils literal"><span class="pre">#defined</span></tt>.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id59" id="tutorial" name="tutorial">8&nbsp;&nbsp;&nbsp;Tutorial</a></h1>
<h1><a class="toc-backref" href="#id49" id="tutorial" name="tutorial">8&nbsp;&nbsp;&nbsp;Tutorial</a></h1>
<p>Follow <a class="reference" href="index.html#tutorial">this link</a> to the Boost.Parameter tutorial
documentation.</p>
<hr class="docutils" />
@@ -1119,7 +897,7 @@ where it could make a difference.</td></tr>
<table class="docutils footnote" frame="void" id="no-result-of" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a name="no-result-of">[2]</a></td><td><em>(<a class="fn-backref" href="#id11">1</a>, <a class="fn-backref" href="#id18">2</a>)</em> Where <a class="reference" href="../../../utility/utility.htm#BOOST_NO_RESULT_OF"><tt class="docutils literal"><span class="pre">BOOST_NO_RESULT_OF</span></tt></a> is <tt class="docutils literal"><span class="pre">#defined</span></tt>,
<tr><td class="label"><a name="no-result-of">[2]</a></td><td><em>(<a class="fn-backref" href="#id11">1</a>, <a class="fn-backref" href="#id17">2</a>)</em> Where <a class="reference" href="../../../utility/utility.htm#BOOST_NO_RESULT_OF"><tt class="docutils literal"><span class="pre">BOOST_NO_RESULT_OF</span></tt></a> is <tt class="docutils literal"><span class="pre">#defined</span></tt>,
<tt class="docutils literal"><span class="pre">boost::</span></tt><a class="reference" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">result_of</span></tt></a><tt class="docutils literal"><span class="pre">&lt;F()&gt;::type</span></tt> is replaced by
<tt class="docutils literal"><span class="pre">F::result_type</span></tt>.</td></tr>
</tbody>
@@ -1128,7 +906,7 @@ where it could make a difference.</td></tr>
</div>
<div class="footer">
<hr class="footer" />
Generated on: 2007-05-03 14:17 UTC.
Generated on: 2007-01-03 17:02 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@@ -19,12 +19,8 @@ img {
}
span.vellipsis {
display: block;
width: 5px;
height: 22px;
background: url("vellipsis.gif");
margin-left: 3em;
text-indent: -1000px;
line-height: 30% ;
font-size: 200% ;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 B

View File

@@ -1067,8 +1067,8 @@ With the declaration above, the following two calls are equivalent:
.. parsed-literal::
def("f", &f, **some_policies**, **"Documentation for f"**);
def("f", &f, **"Documentation for f"**, **some_policies**);
def("f", f, **some_policies**, **"Documentation for f"**);
def("f", f, **"Documentation for f"**, **some_policies**);
.. @example.prepend('''
int main()
@@ -1081,7 +1081,7 @@ specify the parameter name explicitly, as follows:
.. parsed-literal::
def(
"f", &f
"f", f
, **_policies = some_policies**, "Documentation for f");
.. @example.append('}')
@@ -1114,8 +1114,7 @@ be used within the body of a class::
};
.. @example.prepend('''
#include <boost/parameter.hpp>
#include <iostream>''')
#include <boost/parameter.hpp>''')
.. @test('compile')
@@ -1702,10 +1701,7 @@ its function call operator:
, optional<tag::\ index, is_convertible<_,int> >
> spec;
char const sam[] = "sam";
int twelve = 12;
int z0 = print_name_and_index( **spec(**\ sam, twelve\ **)** );
int z0 = print_name_and_index( **spec(**\ "sam", 12\ **)** );
int z1 = print_name_and_index(
**spec(**\ _index=12, _name="sam"\ **)**
@@ -1724,11 +1720,6 @@ its function call operator:
.. @test('run', howmany='all')
Note that because of the `forwarding problem`_, ``parameter::parameters::operator()``
can't accept non-const rvalues.
.. _`forwarding problem`: http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
Extracting Parameter Types
==========================
@@ -1779,9 +1770,7 @@ case we can use the ``binding< … >`` metafunction introduced
BOOST_PARAMETER_NAME(index)
template <class ArgumentPack>
typename remove_reference<
typename parameter::binding<ArgumentPack, tag::index, int>::type
>::type
typename parameter::binding<ArgumentPack, tag::index, int>::type
twice_index(ArgumentPack const& args)
{
return 2 * args[_index|42];
@@ -1789,44 +1778,21 @@ case we can use the ``binding< … >`` metafunction introduced
int six = twice_index(_index = 3);
.. TODO: binding<> returns a reference. We should use value_type<> here.
.. @example.prepend('''
#include <boost/parameter.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <cassert>
namespace parameter = boost::parameter;
using boost::remove_reference;''')
Note that the ``remove_reference< … >`` dance is necessary because
``binding< … >`` will return a reference type when the argument
is bound in the argument pack. If we don't strip the reference we
end up returning a reference to the temporary created in the ``2 * …``
expression. A convenient shortcut would be to use the ``value_type< … >``
metafunction:
.. parsed-literal::
template <class ArgumentPack>
typename **parameter::value_type<ArgumentPack, tag::index, int>**::type
twice_index(ArgumentPack const& args)
{
return 2 * args[_index|42];
}
.. @example.wrap('namespace with_value_type {', '''
int six = twice_index(_index = 3);
}''')
.. TODO: binding<> returns a reference. We should use value_type<> here.
namespace parameter = boost::parameter;''')
.. @example.append('''
int main()
{
assert(six == 6);
assert(with_value_type::six == 6);
}''')
.. @test('run', howmany='all')
.. @test('run')
__ binding_intro_
@@ -1871,31 +1837,21 @@ when using |ArgumentPack|\ s explicitly, we need a tool other than
In the example above, the string ``"hello, world"`` is constructed
despite the fact that the user passed us a value for ``s3``. To
remedy that, we can compute the default value *lazily* (that is,
only on demand), by using ``boost::bind()`` to create a function
object.
.. danielw: I'm leaving the text below in the source, because we might
.. want to change back to it after 1.34, and if I remove it now we
.. might forget about it.
.. by combining the logical-or (“``||``”) operator
.. with a function object built by the Boost Lambda_ library: [#bind]_
only on demand), by combining the logical-or (“``||``”) operator
with a function object built by the Boost Lambda_ library: [#bind]_
.. parsed-literal::
using boost::bind;
using boost::ref;
namespace lambda = boost::lambda;
typename parameter::binding<
ArgumentPack, tag::s3, std::string
>::type s3 = args[_s3 **|| bind(std::plus<std::string>(), ref(s1), ref(s2))** ];
>::type s3 = args[_s3 **|| (lambda::var(s1)+lambda::var(s2))** ];
.. @example.prepend('''
#include <boost/bind.hpp>
#include <boost/ref.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/parameter.hpp>
#include <string>
#include <functional>
namespace parameter = boost::parameter;
@@ -1920,7 +1876,7 @@ object.
.. @test('run')
.. .. _Lambda: ../../../lambda/index.html
.. _Lambda: ../../../lambda/index.html
.. sidebar:: Mnemonics
@@ -1930,15 +1886,10 @@ object.
Similarly, in ``color_map[param||f]``, ``f`` is only invoked if
no ``color_map`` argument was supplied.
The expression ``bind(std::plus<std::string>(), ref(s1), ref(s2))`` yields
a *function object* that, when invoked, adds the two strings together.
That function will only be invoked if no ``s3`` argument is supplied by
the caller.
.. The expression ``lambda::var(s1)+lambda::var(s2)`` yields a
.. *function object* that, when invoked, adds the two strings
.. together. That function will only be invoked if no ``s3`` argument
.. is supplied by the caller.
The expression ``lambda::var(s1)+lambda::var(s2)`` yields a
*function object* that, when invoked, adds the two strings
together. That function will only be invoked if no ``s3`` argument
is supplied by the caller.
================
Best Practices
@@ -2300,17 +2251,17 @@ __ ../../../graph/doc/bgl_named_params.html
.. _`ConceptC++`: http://www.generic-programming.org/software/ConceptGCC/
.. .. [#bind] The Lambda library is known not to work on `some
.. less-conformant compilers`__. When using one of those you could
.. use `Boost.Bind`_ to generate the function object::
.. [#bind] The Lambda library is known not to work on `some
less-conformant compilers`__. When using one of those you could
use `Boost.Bind`_ to generate the function object::
.. boost::bind(std::plus<std::string>(),s1,s2)
boost::bind(std::plus<std::string>(),s1,s2)
.. [#is_keyword_expression] Here we're assuming there's a predicate
metafunction ``is_keyword_expression`` that can be used to
identify models of Boost.Python's KeywordExpression concept.
.. .. __ http://www.boost.org/regression/release/user/lambda.html
__ http://www.boost.org/regression/release/user/lambda.html
.. _Boost.Bind: ../../../bind/index.html

View File

@@ -132,8 +132,7 @@ Python we use the binding utility ``boost::parameter::python::function``.
and pass to ``boost::python::class_::def()``.
To use ``boost::parameter::python::function`` we first need to define
a class with forwarding overloads. This is needed because ``window::open()``
is a function template, so we can't refer to it in any other way.
a class with forwarding overloads.
::
@@ -205,9 +204,7 @@ forwarding overloads that we defined earlier. The second one is an `MPL
Sequence`_ with the keyword tag types and argument types for the function
specified as function types. The pointer syntax used in ``tag::width*`` and
``tag::height*`` means that the parameter is optional. The first element of
the `MPL Sequence`_ is the return type of the function, in this case ``void``,
which is passed as the first argument to ``operator()`` in the forwarding
class.
the `MPL Sequence`_ is the return type of the function, in this case ``void``.
.. The
pointer syntax means that the parameter is optional, so in this case
@@ -298,10 +295,8 @@ the **arity range** of ``mpl::vector2<x(int),y*(int)>`` is ``[2,2]`` and the
Sometimes it is desirable to have a default value for a parameter that differ
in type from the parameter. This technique is useful for doing simple tag-dispatching
based on the presence of a parameter. For example:
.. An example_ of this is given in the Boost.Parameter
docs. The example uses a different technique, but could also have been written like this:
based on the presence of a parameter. An example_ of this is given in the Boost.Parameter
docs. The example uses a different technique, but could also have been written like this:
.. parsed-literal::
@@ -356,20 +351,18 @@ based on the presence of a parameter. For example:
.. @build()
.. .. _example: index.html#dispatching-based-on-the-presence-of-a-default
.. _example: index.html#dispatching-based-on-the-presence-of-a-default
In the above example the type of the default for ``color`` is ``mpl::false_``, a
type that is distinct from any color map that the user might supply.
When binding the case outlined above, the default type for ``color`` will not
be convertible to the parameter type. Therefore we need to tag the ``color``
keyword as a *special* keyword. This is done by specifying the tag as
``tag::color**`` when binding the function (see `concept ParameterSpec`_ for
more details on the tagging). By doing this we tell the binding functions that
it needs to generate two overloads, one with the ``color`` parameter present
and one without. Had there been two *special* keywords, four overloads would
need to be generated. The number of generated overloads is equal to 2\
:sup:`N`, where ``N`` is the number of *special* keywords.
keyword as a *special* keyword. By doing this we tell the binding functions
that it needs to generate two overloads, one with the ``color`` parameter
present and one without. Had there been two *special* keywords, four
overloads would need to be generated. The number of generated overloads is
equal to 2\ :sup:`N`, where ``N`` is the number of *special* keywords.
------------------------------------------------------------------------------

View File

@@ -253,7 +253,7 @@ argument type. In each row,
+----------------------+--------------+--------------------------------+
|Type |``A`` required|Condition ``A`` must satisfy |
+======================+==============+================================+
|``K`` |no |*n/a* |
||keyword|_\ ``<K>`` |no |*n/a* |
+----------------------+--------------+--------------------------------+
||optional|_\ ``<K,F>``|no |``mpl::apply<F,A>::type::value``|
| | |is ``true``. |
@@ -381,15 +381,16 @@ __ ../../../../boost/parameter/parameters.hpp
};
template <class A0>
|ArgumentPack|_ `operator()`_\(A0& a0) const;
|ArgumentPack|_ `operator()`_\(A0 const& a0) const;
template <class A0, class A1>
|ArgumentPack|_ `operator()`_\(A0& a0, A1& a1) const;
:vellipsis:`⋮`
|ArgumentPack|_ `operator()`_\(A0 const& a0, A1 const& a1) const; :vellipsis:`\
.
.
.
`
template <class A0, class A1, …class A\ β>
|ArgumentPack|_ `operator()`_\(A0& a0, A1& a1, …A\ β& a\ β) const;
|ArgumentPack|_ `operator()`_\(A0 const& a0, A1 const& a1, …A\ β const& a\ β) const;
};
@@ -402,22 +403,13 @@ __ ../../../../boost/parameter/parameters.hpp
follows, for any argument type ``A``\ *i*:
| let ``D0`` the set [d0, …, d\ *j*] of all **deduced** *parameter specs* in [``P0``, …, ``P``\ β]
| ``R``\ *i* is ``A``\ *i*\ 's |intended argument type|
|
| if ``A``\ *i* is a result type of ``keyword<T>::``\ |operator=|_
| then
| ``K``\ *i* is ``T``
| else
| if some ``A``\ *j* where *j*\ ≤\ *i* is a result type of ``keyword<T>::``\ |operator=|_
| *or* some ``P``\ *j* in *j*\ ≤\ *i* is **deduced**
| then
| if some *parameter spec* ``d``\ *j* in ``D``\ *i* matches ``A``\ *i*
| then
| ``K``\ *i* is ``d``\ *j*\ 's |keyword tag type|.
| ``D``\ :sub:`i+1` is ``D``\ *i* - [``d``\ *j*]
| else
| ``K``\ *i* is ``P``\ *i*\ 's |keyword tag type|.
| if ``A``\ *i* is a result type of ``keyword<T>::``\ |operator=|_
| then
| ``K``\ *i* is ``T``
| else
| ``K``\ *i* is ``P``\ *i*\ 's |keyword tag type|.
.. _match:
@@ -433,7 +425,7 @@ __ ../../../../boost/parameter/parameters.hpp
every *j* in 0…β, either:
* ``P``\ *j* is the *unspecified* default
* **or**, ``P``\ *j* is a *keyword tag type*
* **or**, ``P``\ *j* is a specialization of |keyword|_,
* **or**, ``P``\ *j* is |optional|_ ``<X,F>`` and either
@@ -451,10 +443,11 @@ __ ../../../../boost/parameter/parameters.hpp
``operator()``
.. parsed-literal::
template <class A0> |ArgumentPack|_ operator()(A0 const& a0) const;
:vellipsis:`⋮`
template <class A0> |ArgumentPack|_ operator()(A0 const& a0) const; :vellipsis:`\
.
.
.
`
template <class A0, …class A\ β> |ArgumentPack|_ `operator()`_\(A0 const& a0, …A\ β const& a\ β) const;
:Returns:
@@ -495,23 +488,6 @@ The default value of ``Predicate`` is an unspecified |Metafunction|_ that return
.. |Metafunction| replace:: :concept:`Metafunction`
.. _Metafunction: ../../../mpl/doc/refmanual/metafunction.html
``deduced``
-----------
This template is used to wrap the *keyword tag* argument to
``optional`` or ``required``.
:Defined in: `boost/parameter/parameters.hpp`__
__ ../../../../boost/parameter/parameters.hpp
.. parsed-literal::
template <class Tag>
struct deduced;
//////////////////////////////////////////////////////////////////////////////
Metafunctions
@@ -570,37 +546,6 @@ __ ../../../../boost/parameter/binding.hpp
reference| exists, returns ``boost::``\ |result_of|_\ ``<F()>::type``. [#no_result_of]_
``value_type``
--------------
Returns the result type of indexing an argument pack with a
|keyword tag type| or with a |tagged default|.
:Defined n: `boost/parameter/value_type.hpp`__
__ ../../../../boost/parameter/value_type.hpp
.. parsed-literal::
template <class A, class K, class D = void>
struct value_type
{
typedef … type;
};
:Requires: ``A`` is a model of |ArgumentPack|_.
:Returns: the type of the |tagged reference| in ``A``
having |keyword tag type| ``K``, if any. If no such |tagged
reference| exists, returns ``D``. Equivalent to::
typename remove_reference<
typename binding<A, K, D>::type
>::type
… when ``D`` is not a reference type.
//////////////////////////////////////////////////////////////////////////////
Code Generation Macros
@@ -609,7 +554,6 @@ Code Generation Macros
Macros in this section can be used to ease the writing of code
using the Parameter libray by eliminating repetitive boilerplate.
``BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)``
-----------------------------------------------------------------
@@ -627,20 +571,17 @@ __ ../../../../boost/parameter/preprocessor.hpp
:Argument specifiers syntax:
.. parsed-literal::
argument-specifiers ::= *specifier-group* {*specifier-group*}
argument-specifiers ::= specifier-group {specifier-group}
specifier-group0 ::= *specifier-group1* |
( '**(**' '**deduced**' *specifier-group1* {*specifier-group1*} '**)**' )
specifier-group ::= ( '(' 'optional' optional-specifier {optional-specifier} ')' ) |
( '(' 'required' required-specifier {required-specifier} ')' )
specifier-group1 ::= ( '**(**' '**optional**' *optional-specifier* {*optional-specifier*} '**)**' ) |
( '**(**' '**required**' *required-specifier* {*required-specifier*} '**)**' )
optional-specifier ::= '(' name ',' restriction ',' default-value ')'
required-specifier ::= '(' name ',' restriction ')'
optional-specifier ::= '**(**' *name* '**,**' *restriction* '**,**' *default-value* ')'
required-specifier ::= '**(**' *name* '**,**' *restriction* ')'
restriction ::= ('*****' '**(**' *lambda-expression* '**)**' ) |
( '**(**' *typename* '**)**' ) |
'*****'
restriction ::= ('*' '(' lambda-expression ')' ) |
( '(' typename ')' ) |
'*'
``name`` is any valid C++ identifier. ``default-value`` is any valid
C++ expression. ``typename`` is the name of a type.
@@ -690,7 +631,11 @@ Approximate expansion:
*… forward to implementation …*
}
:vellipsis:`⋮`
:vellipsis:`\
.
.
.
`
template <class A0, …, class A\ **m**>
*result type* **name**\ (
@@ -716,149 +661,9 @@ Approximate expansion:
, *argument name*\ **m** ## _type& *argument name*\ **m**
)
``BOOST_PARAMETER_MEMBER_FUNCTION(result,name,tag_namespace,arguments)``
------------------------------------------------------------------------
:Defined in: `boost/parameter/preprocessor.hpp`__
__ ../../../../boost/parameter/preprocessor.hpp
See ``BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)``
``BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)``
--------------------------------------------------------------------
:Defined in: `boost/parameter/preprocessor.hpp`__
__ ../../../../boost/parameter/preprocessor.hpp
:Requires: ``cls`` is the name of this class. ``impl`` is the
parenthesized implementation base class for ``cls``.
``tag_namespace`` is the namespace in which the keywords
used by the function resides. ``arguments`` is
a list of *argument specifiers*, as defined in
``BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)``.
:Generated names in enclosing scope:
* ``boost_param_params_ ## __LINE__ ## ctor``
* ``constructor_parameters ## __LINE__``
Approximate expansion:
**Where**:
* ``n`` denotes the *minimum* arity, as determined from ``arguments``.
* ``m`` denotes the *maximum* arity, as determined from ``arguments``.
.. parsed-literal::
struct boost_param_params\_ ## __LINE__ ## ctor
: boost::parameter::parameters<
*list of parameter specifications, based on arguments*
>
{};
typedef boost_param_params\_ ## __LINE__ ## **name**
constructor_parameters ## __LINE__;
template <class A0, …, class A\ **n**>
*cls*\ (A0 const& a0, …, A\ **n** const& a\ **n**)
: *impl*\ (constructor_parameters ## __LINE__(a0, …, a\ **n**))
{}
:vellipsis:`⋮`
template <class A0, …, class A\ **m**>
*cls*\ (A0 const& a0, …, A\ **n** const& a\ **m**)
: *impl*\ (constructor_parameters ## __LINE__(a0, …, a\ **m**))
{}
``BOOST_PARAMETER_NAME(name)``
------------------------------
Declares a tag-type and keyword object.
Expands to:
**If** *name* is of the form:
.. parsed-literal::
(*tag-name*, *namespace-name*) *object-name*
**then**
.. parsed-literal::
namespace *namespace-name*
{
struct *tag-name*
{
static char const* keyword_name()
{
return ##\ *tag-name*;
}
typedef *implementation defined* _;
typedef *implementation defined* _1;
};
}
::boost::parameter::keyword<*tag-namespace*\ ::\ *tag-name*\ > const& *object-name*
= ::boost::parameter::keyword<*tag-namespace*\ ::\ *tag-name*\ >::instance;
**Else**
.. parsed-literal::
namespace tag
{
struct *name*
{
static char const* keyword_name()
{
return ##\ *name*;
}
typedef *implementation defined* _;
typedef *implementation defined* _1;
};
}
::boost::parameter::keyword<tag::\ *name*\ > const& _\ *name*
= ::boost::parameter::keyword<tag::\ *name*\ >::instance;
``BOOST_PARAMETER_TEMPLATE_KEYWORD(name)``
------------------------------------------
Expands to:
.. parsed-literal::
namespace tag
{
struct *name*;
}
template <class T>
struct *name*
: ::boost::parameter::template_keyword<tag::\ *name*, T>
{};
``BOOST_PARAMETER_FUN(r,n,l,h,p)``
----------------------------------
.. admonition:: Deprecated
This macro has been deprecated in favor of
``BOOST_PARAMETER_FUNCTION``.
Generates a sequence of `forwarding function`_ templates named
``n``, with arities ranging from ``l`` to ``h`` , returning ``r``,
and using ``p`` to control overload resolution and assign tags to
@@ -889,10 +694,11 @@ Generates
, typename **p**::match<A1,A2,…A\ **l**,A\ ##\ BOOST_PP_INC_\ (**l**)>::type p = **p**\ ())
{
return **name**\ _with_named_params(**p**\ (x1,x2,…x\ **l**,x\ ##\ BOOST_PP_INC_\ (**l**)));
}
:vellipsis:`⋮`
} :vellipsis:`\
.
.
.
`
template <class A1, class A2, …class A\ **h**>
r name(
A1 const& a1, A2 const& a2, …A\ **h** const& x\ **h**
@@ -907,11 +713,6 @@ Generates
``BOOST_PARAMETER_KEYWORD(n,k)``
--------------------------------
.. admonition:: Deprecated
This macro has been deprecated in favor of
``BOOST_PARAMETER_NAME``.
Generates the declaration of a |keyword tag type| named ``k`` in
namespace ``n``, and a corresponding |keyword object| definition in
the enclosing namespace.

View File

@@ -91,18 +91,14 @@ struct keyword
// every instantiation of a function template is the same object.
// We provide a reference to a common instance of each keyword
// object and prevent construction by users.
static keyword<Tag> const instance;
// This interface is deprecated
static keyword<Tag>& get()
{
return const_cast<keyword<Tag>&>(instance);
static keyword<Tag> result;
return result;
}
};
template <class Tag>
keyword<Tag> const keyword<Tag>::instance = {};
// Reduces boilerplate required to declare and initialize keywords
// without violating ODR. Declares a keyword tag type with the given
// name in namespace tag_namespace, and declares and initializes a
@@ -111,19 +107,19 @@ keyword<Tag> const keyword<Tag>::instance = {};
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
namespace tag_namespace \
{ \
struct name \
{ \
static char const* keyword_name() \
{ \
return #name; \
} \
}; \
} \
static ::boost::parameter::keyword<tag_namespace::name> const& name \
= ::boost::parameter::keyword<tag_namespace::name>::instance;
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
namespace tag_namespace \
{ \
struct name \
{ \
static char const* keyword_name() \
{ \
return #name; \
} \
}; \
} \
static ::boost::parameter::keyword<tag_namespace::name>& name \
= ::boost::parameter::keyword<tag_namespace::name>::get();
#else
@@ -140,8 +136,8 @@ keyword<Tag> const keyword<Tag>::instance = {};
} \
namespace \
{ \
::boost::parameter::keyword<tag_namespace::name> const& name \
= ::boost::parameter::keyword<tag_namespace::name>::instance;\
::boost::parameter::keyword<tag_namespace::name>& name \
= ::boost::parameter::keyword<tag_namespace::name>::get(); \
}
#endif

View File

@@ -76,14 +76,14 @@ struct lambda<
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
static ::boost::parameter::keyword<tag> const& name \
= ::boost::parameter::keyword<tag>::instance;
static ::boost::parameter::keyword<tag>& name \
= ::boost::parameter::keyword<tag>::get();
# else
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
namespace \
{ \
::boost::parameter::keyword<tag> const& name \
= ::boost::parameter::keyword<tag>::instance; \
::boost::parameter::keyword<tag>& name \
= ::boost::parameter::keyword<tag>::get(); \
}
# endif

View File

@@ -835,7 +835,7 @@ struct parameters
// !!!NOTE!!!
//
// The make_arg_list<> produces a reversed arg_list, so
// we need to pass the arguments to its constructor
// we need to pass the arguments to it's constructor
// reversed.
//
aux::empty_arg_list operator()() const

View File

@@ -685,7 +685,7 @@ struct funptr_predicate<void**>
# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT(arg, tag_namespace) \
boost::parameter::keyword< \
tag_namespace::BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \
>::instance | boost::parameter::aux::use_default_tag()
>::get() | boost::parameter::aux::use_default_tag()
# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG(arg, tag_ns) \
BOOST_PARAMETER_FUNCTION_CAST( \
@@ -834,7 +834,7 @@ struct funptr_predicate<void**>
# define BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG(r, tag_ns, arg) \
, BOOST_PARAMETER_FUNCTION_CAST( \
args[ \
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::instance \
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::get() \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
)

View File

@@ -107,6 +107,6 @@ int main()
//f(index = 56, name = 55); // won't compile
return boost::report_errors();
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <boost/assert.hpp>
#include <boost/mpl/assert.hpp>
#include <cstring>
#include <boost/detail/lightweight_test.hpp>
namespace test {
@@ -80,9 +79,9 @@ struct values_t
BOOST_MPL_ASSERT((boost::is_same<Value,Value_>));
BOOST_MPL_ASSERT((boost::is_same<Name,Name_>));
#endif
BOOST_TEST(equal(n, n_));
BOOST_TEST(equal(v, v_));
BOOST_TEST(equal(i, i_));
BOOST_ASSERT(equal(n, n_));
BOOST_ASSERT(equal(v, v_));
BOOST_ASSERT(equal(i, i_));
}
Name const& n;