Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / parameter / doc / html / reference.html
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
7 <title>The Boost Parameter Library Reference Documentation</title>
8 <meta name="authors" content="David Abrahams  Daniel Wallin" />
9 <meta name="organization" content="BoostPro Computing" />
10 <meta name="date" content="2005-07-17" />
11 <meta name="copyright" content="Copyright David Abrahams, Daniel Wallin 2005-2009.  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)" />
12 <link rel="stylesheet" href="rst.css" type="text/css" />
13 </head>
14 <body>
15 <div class="document" id="the-boost-parameter-library-reference-documentation">
16 <h1 class="title">The Boost Parameter Library Reference Documentation</h1>
17 <table class="docinfo" frame="void" rules="none">
18 <col class="docinfo-name" />
19 <col class="docinfo-content" />
20 <tbody valign="top">
21 <tr><th class="docinfo-name">Authors:</th>
22 <td>David Abrahams
23 <br />Daniel Wallin</td></tr>
24 <tr><th class="docinfo-name">Contact:</th>
25 <td><a class="first reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="last reference external" href="mailto:daniel&#64;boostpro.com">daniel&#64;boostpro.com</a></td></tr>
26 <tr><th class="docinfo-name">Organization:</th>
27 <td><a class="first last reference external" href="http://www.boostpro.com">BoostPro Computing</a></td></tr>
28 <tr><th class="docinfo-name">Date:</th>
29 <td>2005-07-17</td></tr>
30 <tr><th class="docinfo-name">Copyright:</th>
31 <td>Copyright David Abrahams, Daniel Wallin
32 2005-2009.  Distributed under the Boost Software License,
33 Version 1.0.  (See accompanying file LICENSE_1_0.txt
34 or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</td></tr>
35 </tbody>
36 </table>
37 <p><a class="reference external" href="../../../../index.htm"><img alt="Boost" src="../../../../boost.png" /></a></p>
38 <hr class="docutils" />
39 <div class="contents topic" id="contents">
40 <p class="topic-title first">Contents</p>
41 <ul class="auto-toc simple">
42 <li><a class="reference internal" href="#preliminaries" id="id31">1&nbsp;&nbsp;&nbsp;Preliminaries</a><ul class="auto-toc">
43 <li><a class="reference internal" href="#namespaces" id="id32">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></li>
44 <li><a class="reference internal" href="#exceptions" id="id33">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></li>
45 <li><a class="reference internal" href="#thread-safety" id="id34">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></li>
46 <li><a class="reference internal" href="#typography" id="id35">1.4&nbsp;&nbsp;&nbsp;Typography</a></li>
47 </ul>
48 </li>
49 <li><a class="reference internal" href="#terminology" id="id36">2&nbsp;&nbsp;&nbsp;Terminology</a></li>
50 <li><a class="reference internal" href="#concepts" id="id37">3&nbsp;&nbsp;&nbsp;Concepts</a><ul class="auto-toc">
51 <li><a class="reference internal" href="#argumentpack" id="id38">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></li>
52 <li><a class="reference internal" href="#id3" id="id39">3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></li>
53 </ul>
54 </li>
55 <li><a class="reference internal" href="#class-templates" id="id40">4&nbsp;&nbsp;&nbsp;Class Templates</a><ul class="auto-toc">
56 <li><a class="reference internal" href="#id5" id="id41">4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">keyword</tt></a></li>
57 <li><a class="reference internal" href="#id7" id="id42">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">template_keyword</tt></a></li>
58 <li><a class="reference internal" href="#id8" id="id43">4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">parameters</tt></a></li>
59 <li><a class="reference internal" href="#optional-required" id="id44">4.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">optional</tt>, <tt class="docutils literal">required</tt></a></li>
60 <li><a class="reference internal" href="#id9" id="id45">4.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">deduced</tt></a></li>
61 </ul>
62 </li>
63 <li><a class="reference internal" href="#metafunctions" id="id46">5&nbsp;&nbsp;&nbsp;Metafunctions</a><ul class="auto-toc">
64 <li><a class="reference internal" href="#id10" id="id47">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">binding</tt></a></li>
65 <li><a class="reference internal" href="#id11" id="id48">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">lazy_binding</tt></a></li>
66 <li><a class="reference internal" href="#id13" id="id49">5.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">value_type</tt></a></li>
67 <li><a class="reference internal" href="#id14" id="id50">5.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">lazy_value_type</tt></a></li>
68 <li><a class="reference internal" href="#id16" id="id51">5.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">are_tagged_arguments</tt></a></li>
69 <li><a class="reference internal" href="#id17" id="id52">5.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">is_argument_pack</tt></a></li>
70 <li><a class="reference internal" href="#id18" id="id53">5.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">result_of::compose</span></tt></a></li>
71 </ul>
72 </li>
73 <li><a class="reference internal" href="#function-templates" id="id54">6&nbsp;&nbsp;&nbsp;Function Templates</a><ul class="auto-toc">
74 <li><a class="reference internal" href="#id19" id="id55">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">compose</tt></a></li>
75 </ul>
76 </li>
77 <li><a class="reference internal" href="#code-generation-macros" id="id56">7&nbsp;&nbsp;&nbsp;Code Generation Macros</a><ul class="auto-toc">
78 <li><a class="reference internal" href="#boost-parameter-function-result-name-tag-namespace-arguments" id="id57">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, arguments)</tt></a></li>
79 <li><a class="reference internal" href="#boost-parameter-member-function-result-name-tag-namespace-arguments" id="id58">7.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, arguments)</tt></a></li>
80 <li><a class="reference internal" href="#boost-parameter-const-member-function-result-name-tag-ns-arguments" id="id59">7.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_ns, arguments)</tt></a></li>
81 <li><a class="reference internal" href="#boost-parameter-function-call-operator-result-tag-namespace-arguments" id="id60">7.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_namespace, arguments)</tt></a></li>
82 <li><a class="reference internal" href="#boost-parameter-const-function-call-operator-result-tag-ns-arguments" id="id61">7.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)</tt></a></li>
83 <li><a class="reference internal" href="#boost-parameter-constructor-cls-impl-tag-namespace-arguments" id="id62">7.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)</tt></a></li>
84 <li><a class="reference internal" href="#boost-parameter-basic-function-result-name-tag-namespace-arguments" id="id63">7.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, arguments)</tt></a></li>
85 <li><a class="reference internal" href="#boost-parameter-basic-member-function-result-name-tag-ns-arguments" id="id64">7.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_ns, arguments)</tt></a></li>
86 <li><a class="reference internal" href="#boost-parameter-basic-const-member-function-result-name-tag-ns-args" id="id65">7.9&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_ns, args)</tt></a></li>
87 <li><a class="reference internal" href="#boost-parameter-basic-function-call-operator-result-tag-ns-arguments" id="id66">7.10&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)</tt></a></li>
88 <li><a class="reference internal" href="#boost-parameter-basic-const-function-call-operator-result-tag-ns-args" id="id67">7.11&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, args)</tt></a></li>
89 <li><a class="reference internal" href="#boost-parameter-no-spec-function-result-name" id="id68">7.12&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION(result, name)</tt></a></li>
90 <li><a class="reference internal" href="#boost-parameter-no-spec-member-function-result-name" id="id69">7.13&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, name)</tt></a></li>
91 <li><a class="reference internal" href="#boost-parameter-no-spec-const-member-function-result-name" id="id70">7.14&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, name)</tt></a></li>
92 <li><a class="reference internal" href="#boost-parameter-no-spec-function-call-operator-result" id="id71">7.15&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result)</tt></a></li>
93 <li><a class="reference internal" href="#boost-parameter-no-spec-const-function-call-operator-result" id="id72">7.16&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result)</tt></a></li>
94 <li><a class="reference internal" href="#boost-parameter-no-spec-constructor-cls-impl" id="id73">7.17&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(cls, impl)</tt></a></li>
95 <li><a class="reference internal" href="#boost-parameter-no-spec-no-base-constructor-cls-impl" id="id74">7.18&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(cls, impl)</tt></a></li>
96 <li><a class="reference internal" href="#boost-parameter-name-name" id="id75">7.19&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NAME(name)</tt></a></li>
97 <li><a class="reference internal" href="#boost-parameter-nested-keyword-tag-namespace-name-alias" id="id76">7.20&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)</tt></a></li>
98 <li><a class="reference internal" href="#boost-parameter-template-keyword-name" id="id77">7.21&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_TEMPLATE_KEYWORD(name)</tt></a></li>
99 <li><a class="reference internal" href="#boost-parameter-fun-r-n-l-h-p" id="id78">7.22&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUN(r, n, l, h, p)</tt></a></li>
100 <li><a class="reference internal" href="#boost-parameter-keyword-n-k" id="id79">7.23&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_KEYWORD(n, k)</tt></a></li>
101 <li><a class="reference internal" href="#boost-parameter-match-p-a-x" id="id80">7.24&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MATCH(p, a, x)</tt></a></li>
102 </ul>
103 </li>
104 <li><a class="reference internal" href="#configuration-macros" id="id81">8&nbsp;&nbsp;&nbsp;Configuration Macros</a><ul class="auto-toc">
105 <li><a class="reference internal" href="#id21" id="id82">8.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a></li>
106 <li><a class="reference internal" href="#id22" id="id83">8.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING</tt></a></li>
107 <li><a class="reference internal" href="#id23" id="id84">8.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a></li>
108 <li><a class="reference internal" href="#id24" id="id85">8.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_DISABLE_MP11_USAGE</tt></a></li>
109 <li><a class="reference internal" href="#id25" id="id86">8.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a></li>
110 <li><a class="reference internal" href="#id26" id="id87">8.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MAX_ARITY</tt></a></li>
111 <li><a class="reference internal" href="#id27" id="id88">8.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_COMPOSE_MAX_ARITY</tt></a></li>
112 <li><a class="reference internal" href="#id28" id="id89">8.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY</tt></a></li>
113 <li><a class="reference internal" href="#outside-of-this-library" id="id90">8.9&nbsp;&nbsp;&nbsp;...Outside Of This Library</a></li>
114 </ul>
115 </li>
116 <li><a class="reference internal" href="#tutorial" id="id91">9&nbsp;&nbsp;&nbsp;Tutorial</a></li>
117 </ul>
118 </div>
119 <hr class="docutils" />
120 <div class="section" id="preliminaries">
121 <h1><a class="toc-backref" href="#id31">1&nbsp;&nbsp;&nbsp;Preliminaries</a></h1>
122 <p>This section covers some basic information you'll need to know in order to
123 understand this reference.</p>
124 <div class="section" id="namespaces">
125 <h2><a class="toc-backref" href="#id32">1.1&nbsp;&nbsp;&nbsp;Namespaces</a></h2>
126 <p>In this document, all unqualified identifiers should be assumed to be defined
127 in namespace <tt class="docutils literal"><span class="pre">boost::parameter</span></tt> unless otherwise specified.</p>
128 </div>
129 <div class="section" id="exceptions">
130 <h2><a class="toc-backref" href="#id33">1.2&nbsp;&nbsp;&nbsp;Exceptions</a></h2>
131 <p>No operation described in this document throws an exception unless otherwise
132 specified.</p>
133 </div>
134 <div class="section" id="thread-safety">
135 <h2><a class="toc-backref" href="#id34">1.3&nbsp;&nbsp;&nbsp;Thread Safety</a></h2>
136 <p>All components of this library can be used safely from multiple threads
137 without synchronization.<a class="footnote-reference" href="#thread" id="id2"><sup>1</sup></a></p>
138 </div>
139 <div class="section" id="typography">
140 <h2><a class="toc-backref" href="#id35">1.4&nbsp;&nbsp;&nbsp;Typography</a></h2>
141 <p>Names written in <span class="concept">sans serif type</span> represent <a class="reference internal" href="#concepts">concepts</a>.</p>
142 <p>In code blocks, <em>italic type</em> represents unspecified text that satisfies the
143 requirements given in the detailed description that follows the code block.</p>
144 <p>In a specification of the tokens generated by a macro, <strong>bold type</strong> is used
145 to highlight the position of the expanded macro argument in the result.</p>
146 <p>The special character β represents the value of <a class="reference internal" href="#boost-parameter-max-arity"><tt class="docutils literal">BOOST_PARAMETER_MAX_ARITY</tt></a>.</p>
147 </div>
148 </div>
149 <hr class="docutils" />
150 <div class="section" id="terminology">
151 <h1><a class="toc-backref" href="#id36">2&nbsp;&nbsp;&nbsp;Terminology</a></h1>
152 <dl class="docutils" id="kw">
153 <dt>keyword</dt>
154 <dd>The name of a function parameter.</dd>
155 </dl>
156 <span class="target" id="keyword-tag-type"></span><dl class="docutils">
157 <dt>keyword tag type</dt>
158 <dd>A type used to uniquely identify a function parameter.  Typically its name
159 will be the same as that of the parameter.</dd>
160 </dl>
161 <span class="target" id="positional"></span><dl class="docutils">
162 <dt>positional argument</dt>
163 <dd>An argument passed with no explicit keyword.  Its parameter is determined
164 in the usual C++ way: by position with respect to a parameter list.</dd>
165 </dl>
166 <span class="target" id="tag-type"></span><dl class="docutils">
167 <dt>tag type</dt>
168 <dd>Shorthand for “<a class="reference internal" href="#keyword-tag-type">keyword tag type</a>.”</dd>
169 </dl>
170 <span class="target" id="keyword-object"></span><dl class="docutils">
171 <dt>keyword object</dt>
172 <dd>An instance of <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tt class="docutils literal">&lt;T&gt;</tt> for some <a class="reference internal" href="#tag-type">tag type</a> <tt class="docutils literal">T</tt>.</dd>
173 </dl>
174 <span class="target" id="tagged-reference"></span><dl class="docutils">
175 <dt>tagged reference</dt>
176 <dd><p class="first">An object whose type is associated with a <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> (the object's
177 <em>keyword</em>), and that holds a reference (to the object's <em>value</em>).</p>
178 <p class="last">As a shorthand, a “tagged reference to <tt class="docutils literal">x</tt>” means a tagged reference
179 whose <em>value</em> is <tt class="docutils literal">x</tt>.</p>
180 </dd>
181 </dl>
182 <span class="target" id="tagged-default"></span><dl class="docutils">
183 <dt>tagged default</dt>
184 <dd>A <a class="reference internal" href="#tagged-reference">tagged reference</a> whose <em>value</em> represents the value of a
185 default argument.</dd>
186 </dl>
187 <span class="target" id="tagged-lazy-default"></span><dl class="docutils">
188 <dt>tagged lazy default</dt>
189 <dd>A <a class="reference internal" href="#tagged-reference">tagged reference</a> whose <em>value</em>, when invoked with no arguments,
190 computes a default argument value.</dd>
191 </dl>
192 <span class="target" id="intended-argument-type"></span><dl class="docutils">
193 <dt>intended argument type</dt>
194 <dd>The <em>intended argument type</em> of a single-element <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> is the
195 type of its element's <em>value</em>.  The intended argument type of any other
196 type <tt class="docutils literal">X</tt> is <tt class="docutils literal">X</tt> itself.</dd>
197 </dl>
198 <div class="note">
199 <p class="first admonition-title">Note</p>
200 <p class="last">In this reference, we will use concept names (and other names) to describe
201 both types and objects, depending on context.  So for example, “an
202 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>” can refer to a type that models <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
203 <em>or</em> an object of such a type.</p>
204 </div>
205 </div>
206 <hr class="docutils" />
207 <div class="section" id="concepts">
208 <h1><a class="toc-backref" href="#id37">3&nbsp;&nbsp;&nbsp;Concepts</a></h1>
209 <p>This section describes the generic type concepts used by the Parameter
210 library.</p>
211 <div class="section" id="argumentpack">
212 <h2><a class="toc-backref" href="#id38">3.1&nbsp;&nbsp;&nbsp;<span class="concept">ArgumentPack</span></a></h2>
213 <p>An <span class="concept">ArgumentPack</span> is a collection of <a class="reference internal" href="#tagged-reference">tagged reference</a>s to the actual
214 arguments passed to a function.  Every <span class="concept">ArgumentPack</span> is also a valid <a class="reference external" href="../../../mpl/doc/refmanual/forward-sequence.html">MPL
215 Forward Sequence</a> and <a class="reference external" href="../../../mpl/doc/refmanual/associative-sequence.html">MPL Associative Sequence</a> consisting of the <a class="reference internal" href="#keyword-tag-type">keyword tag type</a>s in its <a class="reference internal" href="#tagged-reference">tagged reference</a>s.  If <tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt>
216 is defined, then every <span class="concept">ArgumentPack</span> is also a valid <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a> map whose
217 keys are <a class="reference internal" href="#keyword-tag-type">keyword tag type</a>s.  The <a class="reference external" href="../../test/singular.cpp">singular.cpp</a>, <a class="reference external" href="../../test/compose.cpp">compose.cpp</a>, and
218 <a class="reference external" href="../../test/mpl.cpp">mpl.cpp</a> test programs demonstrate this functionality.</p>
219 <div class="section" id="requirements">
220 <h3>Requirements</h3>
221 <p>In the table below,</p>
222 <ul class="simple">
223 <li><tt class="docutils literal">A</tt> is a model of <span class="concept">ArgumentPack</span></li>
224 <li><tt class="docutils literal">x</tt> is an instance of <tt class="docutils literal">A</tt></li>
225 <li><tt class="docutils literal">u</tt> is a <a class="reference internal" href="#keyword-object">keyword object</a> of type <tt class="docutils literal">K</tt></li>
226 <li><tt class="docutils literal">v</tt> is a <a class="reference internal" href="#tagged-default">tagged default</a> with <a class="reference internal" href="#tag-type">tag type</a> <tt class="docutils literal">L</tt> and <em>value</em> of type <tt class="docutils literal">D</tt></li>
227 <li><tt class="docutils literal">w</tt> is a <a class="reference internal" href="#tagged-lazy-default">tagged lazy default</a> with <a class="reference internal" href="#tag-type">tag type</a> <tt class="docutils literal">M</tt> and <em>value</em> of type <tt class="docutils literal">E const</tt></li>
228 <li><tt class="docutils literal">z</tt> is an <span class="concept">ArgumentPack</span> containing a single element (as created by <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tt class="docutils literal"><span class="pre">&lt;…&gt;::operator=</span></tt>)</li>
229 </ul>
230 <p>Any exceptions thrown from the invocation of <tt class="docutils literal">w</tt>'s <em>value</em>
231 will be propagated to the caller.</p>
232 <table border="1" class="docutils">
233 <caption><span class="concept">ArgumentPack</span> requirements</caption>
234 <colgroup>
235 <col width="14%" />
236 <col width="40%" />
237 <col width="19%" />
238 <col width="27%" />
239 </colgroup>
240 <thead valign="bottom">
241 <tr><th class="head">Expression</th>
242 <th class="head">Type</th>
243 <th class="head">Requirements</th>
244 <th class="head">Semantics/Notes</th>
245 </tr>
246 </thead>
247 <tbody valign="top">
248 <tr><td><tt class="docutils literal">x[u]</tt></td>
249 <td><tt class="docutils literal">binding&lt;A, <span class="pre">K&gt;::type</span></tt></td>
250 <td><tt class="docutils literal">x</tt> contains
251 an element <em>b</em>
252 whose <a class="reference internal" href="#kw">keyword</a> is
253 <tt class="docutils literal">K</tt></td>
254 <td>Returns <em>b</em>'s
255 <em>value</em> (by
256 reference).</td>
257 </tr>
258 <tr><td><tt class="docutils literal">x[u]</tt></td>
259 <td><tt class="docutils literal">binding&lt;A, L, <span class="pre">D&gt;::type</span></tt></td>
260 <td><em>none</em></td>
261 <td>If <tt class="docutils literal">x</tt> contains an
262 element <em>b</em> whose
263 <a class="reference internal" href="#kw">keyword</a> is the same as
264 <tt class="docutils literal">u</tt>'s, returns
265 <em>b</em>'s <em>value</em> (by
266 reference).
267 Otherwise, returns
268 <tt class="docutils literal">u</tt>'s <em>value</em>.</td>
269 </tr>
270 <tr><td><tt class="docutils literal">x[w]</tt></td>
271 <td><tt class="docutils literal">lazy_binding&lt;A, M, <span class="pre">E&gt;::type</span></tt></td>
272 <td><em>none</em></td>
273 <td>If <tt class="docutils literal">x</tt> contains an
274 element <em>b</em> whose
275 <a class="reference internal" href="#kw">keyword</a> is the same as
276 <tt class="docutils literal">w</tt>'s, returns
277 <em>b</em>'s <em>value</em> (by
278 reference).
279 Otherwise, invokes
280 <tt class="docutils literal">w</tt>'s <em>value</em>
281 and returns the
282 result.</td>
283 </tr>
284 <tr><td><tt class="docutils literal">x, z</tt></td>
285 <td>Model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a></td>
286 <td><em>none</em></td>
287 <td>Returns an
288 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
289 containing all the
290 elements of both
291 <tt class="docutils literal">x</tt> and <tt class="docutils literal">z</tt>.</td>
292 </tr>
293 </tbody>
294 </table>
295 </div>
296 </div>
297 <div class="section" id="id3">
298 <span id="parameterspec"></span><h2><a class="toc-backref" href="#id39">3.2&nbsp;&nbsp;&nbsp;<span class="concept">ParameterSpec</span></a></h2>
299 <p>A <span class="concept">ParameterSpec</span> describes the type requirements for arguments corresponding
300 to a given <a class="reference internal" href="#kw">keyword</a> and indicates whether the argument is optional or
301 required.  The table below details the allowed forms and describes their
302 condition for satisfaction by an actual argument type. In each row,</p>
303 <ul class="simple" id="conditions">
304 <li><tt class="docutils literal">K</tt> is the <span class="concept">ParameterSpec</span>'s <a class="reference internal" href="#keyword-tag-type">keyword tag type</a></li>
305 <li><tt class="docutils literal">A</tt> is an <a class="reference internal" href="#intended-argument-type">intended argument type</a> associated with <tt class="docutils literal">K</tt>, if any</li>
306 <li><tt class="docutils literal">P</tt> is a model of <span class="concept">ArgumentPack</span> that contains <tt class="docutils literal">A</tt></li>
307 <li><tt class="docutils literal">F</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a></li>
308 </ul>
309 <table border="1" class="docutils">
310 <caption><span class="concept">ParameterSpec</span> allowed forms and conditions of satisfaction</caption>
311 <colgroup>
312 <col width="32%" />
313 <col width="14%" />
314 <col width="54%" />
315 </colgroup>
316 <thead valign="bottom">
317 <tr><th class="head">Type</th>
318 <th class="head"><tt class="docutils literal">A</tt>
319 required</th>
320 <th class="head">Condition <tt class="docutils literal">A</tt> must satisfy</th>
321 </tr>
322 </thead>
323 <tbody valign="top">
324 <tr><td><tt class="docutils literal">K</tt></td>
325 <td>no</td>
326 <td><em>n/a</em></td>
327 </tr>
328 <tr><td><a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><tt class="docutils literal">&lt;K,F&gt;</tt></td>
329 <td>no</td>
330 <td><tt class="docutils literal"><span class="pre">mpl::apply2&lt;F,A,P&gt;::type::value</span></tt> is
331 <tt class="docutils literal">true</tt>.</td>
332 </tr>
333 <tr><td><a class="reference internal" href="#required"><tt class="docutils literal">required</tt></a><tt class="docutils literal">&lt;K,F&gt;</tt></td>
334 <td>yes</td>
335 <td><tt class="docutils literal"><span class="pre">mpl::apply2&lt;F,A,P&gt;::type::value</span></tt> is
336 <tt class="docutils literal">true</tt>.</td>
337 </tr>
338 </tbody>
339 </table>
340 <p>The information in a <span class="concept">ParameterSpec</span> is used to <a class="reference external" href="index.html#controlling-overload-resolution">limit</a> the arguments that
341 will be matched by <a class="reference external" href="index.html#forwarding-functions">forwarding functions</a>.</p>
342 </div>
343 </div>
344 <hr class="docutils" />
345 <div class="section" id="class-templates">
346 <h1><a class="toc-backref" href="#id40">4&nbsp;&nbsp;&nbsp;Class Templates</a></h1>
347 <div class="section" id="id5">
348 <span id="keyword"></span><h2><a class="toc-backref" href="#id41">4.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">keyword</tt></a></h2>
349 <p>The type of every <a class="reference internal" href="#keyword-object">keyword object</a> is a specialization of <tt class="docutils literal">keyword</tt>.</p>
350 <table class="docutils field-list" frame="void" rules="none">
351 <col class="field-name" />
352 <col class="field-body" />
353 <tbody valign="top">
354 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/keyword.hpp">boost/parameter/keyword.hpp</a></td>
355 </tr>
356 </tbody>
357 </table>
358 <pre class="literal-block">
359 template &lt;typename Tag&gt;
360 struct keyword
361 {
362     typedef Tag tag;
363
364     template &lt;typename T&gt;
365     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
366         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
367             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
368           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for scalar types.
369           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
370                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
371                     typename Tag::qualifier
372                   , boost::parameter::in_reference
373                 &gt;
374               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;in&quot; references.
375               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
376                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
377                         typename Tag::qualifier
378                       , boost::parameter::forward_reference
379                     &gt;
380                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
381                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
382                 &gt;
383             &gt;
384         &gt;::type
385       , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
386     &gt;::type
387         <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T const&amp; value) const;
388
389     template &lt;typename T&gt;
390     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
391         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
392             typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
393                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
394                     typename Tag::qualifier
395                   , boost::parameter::out_reference
396                 &gt;
397               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is &quot;out&quot;.
398               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
399                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
400                         typename Tag::qualifier
401                       , boost::parameter::forward_reference
402                     &gt;
403                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is &quot;forward&quot;.
404                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // The reference category is neither &quot;out&quot; nor &quot;forward&quot;.
405                 &gt;
406             &gt;::type
407           , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
408                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_const.html">boost::is_const</a>&lt;T&gt;
409               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for reference-to-const types.
410               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for referece-to-mutable types.
411             &gt;
412           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for references neither &quot;out&quot; nor &quot;forward&quot;.
413         &gt;::type
414       , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
415     &gt;::type
416         <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T&amp; value) const;
417
418     template &lt;typename T&gt;
419     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
420         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
421             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
422           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for scalar types.
423           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
424                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
425                     typename Tag::qualifier
426                   , boost::parameter::in_reference
427                 &gt;
428               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;in&quot; references.
429               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
430                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
431                         typename Tag::qualifier
432                       , boost::parameter::forward_reference
433                     &gt;
434                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
435                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
436                 &gt;
437             &gt;
438         &gt;::type
439       , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
440     &gt;::type
441         <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T const&amp;&amp; value) const;
442
443     template &lt;typename T&gt;
444     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
445         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
446             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
447           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for scalar types.
448           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
449                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
450                     typename Tag::qualifier
451                   , boost::parameter::consume_reference
452                 &gt;
453               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;consume&quot; references.
454               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
455                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
456                         typename Tag::qualifier
457                       , boost::parameter::forward_reference
458                     &gt;
459                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
460                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
461                 &gt;
462             &gt;
463         &gt;::type
464       , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
465     &gt;::type
466         <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T&amp;&amp; value) const;
467
468     template &lt;typename T&gt;
469     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
470         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
471             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
472           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for scalar types.
473           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
474                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
475                     typename Tag::qualifier
476                   , boost::parameter::in_reference
477                 &gt;
478               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;in&quot; references.
479               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
480                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
481                         typename Tag::qualifier
482                       , boost::parameter::forward_reference
483                     &gt;
484                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
485                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
486                 &gt;
487             &gt;
488         &gt;::type
489       , <em>tagged default</em>
490     &gt;::type
491         <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T const&amp; x) const;
492
493     template &lt;typename T&gt;
494     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
495         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
496             typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
497                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
498                     typename Tag::qualifier
499                   , boost::parameter::out_reference
500                 &gt;
501               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is &quot;out&quot;.
502               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
503                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
504                         typename Tag::qualifier
505                       , boost::parameter::forward_reference
506                     &gt;
507                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is &quot;forward&quot;.
508                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // The reference category is neither &quot;out&quot; nor &quot;forward&quot;.
509                 &gt;
510             &gt;::type
511           , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
512                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_const.html">boost::is_const</a>&lt;T&gt;
513               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for reference-to-const types.
514               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for referece-to-mutable types.
515             &gt;
516           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for references neither &quot;out&quot; nor &quot;forward&quot;.
517         &gt;::type
518       , <em>tagged default</em>
519     &gt;::type
520         <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T&amp; x) const;
521
522     template &lt;typename T&gt;
523     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
524         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
525             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
526           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for scalar types.
527           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
528                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
529                     typename Tag::qualifier
530                   , boost::parameter::in_reference
531                 &gt;
532               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;in&quot; references.
533               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
534                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
535                         typename Tag::qualifier
536                       , boost::parameter::forward_reference
537                     &gt;
538                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
539                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
540                 &gt;
541             &gt;
542         &gt;::type
543       , <em>tagged default</em>
544     &gt;::type
545         <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T const&amp;&amp; x) const;
546
547     template &lt;typename T&gt;
548     constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
549         typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
550             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a>&lt;T&gt;
551           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for scalar types.
552           , <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a>&lt;
553                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
554                     typename Tag::qualifier
555                   , boost::parameter::consume_reference
556                 &gt;
557               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;consume&quot; references.
558               , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
559                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
560                         typename Tag::qualifier
561                       , boost::parameter::forward_reference
562                     &gt;
563                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for &quot;forward&quot; references.
564                   , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
565                 &gt;
566             &gt;
567         &gt;::type
568       , <em>tagged default</em>
569     &gt;::type constexpr
570         <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T&amp;&amp; value) const;
571
572     template &lt;typename F&gt;
573     constexpr <em>tagged lazy default</em> <a class="reference internal" href="#logical-or-operator"><tt class="docutils literal">operator||</tt></a>(F const&amp;) const;
574
575     template &lt;typename F&gt;
576     constexpr <em>tagged lazy default</em> <a class="reference internal" href="#logical-or-operator"><tt class="docutils literal">operator||</tt></a>(F&amp;) const;
577
578     static keyword&lt;Tag&gt; const&amp; instance;
579
580     static keyword&lt;Tag&gt;&amp; <a class="reference internal" href="#get">get</a>();
581 };
582 </pre>
583 <p id="assignment-operator"><tt class="docutils literal">operator=</tt></p>
584 <table class="docutils field-list" frame="void" rules="none">
585 <col class="field-name" />
586 <col class="field-body" />
587 <tbody valign="top">
588 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
589 </tr>
590 </tbody>
591 </table>
592 <pre class="literal-block">
593 template &lt;typename T&gt;
594 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T const&amp; value) const;
595
596 template &lt;typename T&gt;
597 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T&amp; value) const;
598
599 template &lt;typename T&gt;
600 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T const&amp;&amp; value) const;
601
602 template &lt;typename T&gt;
603 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T&amp;&amp; value) const;
604 </pre>
605 <table class="docutils field-list" frame="void" rules="none">
606 <col class="field-name" />
607 <col class="field-body" />
608 <tbody valign="top">
609 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">one of the following:</td>
610 </tr>
611 </tbody>
612 </table>
613 <ul class="simple">
614 <li>The nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">forward_reference</tt>.</li>
615 <li>To use the <tt class="docutils literal">const</tt> lvalue reference overload, <tt class="docutils literal">T</tt> must be scalar, or
616 the nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">in_reference</tt>.</li>
617 <li>To use the mutable lvalue reference overload, the nested <tt class="docutils literal">qualifier</tt>
618 type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">out_reference</tt> or <tt class="docutils literal">in_out_reference</tt>, and
619 <tt class="docutils literal">T</tt> must not be <tt class="docutils literal">const</tt>-qualified.</li>
620 <li>To use the <tt class="docutils literal">const</tt> rvalue reference overload for non-scalar <tt class="docutils literal">T</tt>, the
621 nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">in_reference</tt>.</li>
622 <li>To use the mutable rvalue reference overload for non-scalar <tt class="docutils literal">T</tt>, the
623 nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">consume_reference</tt> or
624 <tt class="docutils literal">move_from_reference</tt>.</li>
625 </ul>
626 <table class="docutils field-list" frame="void" rules="none">
627 <col class="field-name" />
628 <col class="field-body" />
629 <tbody valign="top">
630 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">an <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>  containing a single <a class="reference internal" href="#tagged-reference">tagged reference</a> to
631 <tt class="docutils literal">value</tt> with <a class="reference internal" href="#kw">keyword</a> <tt class="docutils literal">Tag</tt></td>
632 </tr>
633 </tbody>
634 </table>
635 <p id="bitwise-or-operator"><tt class="docutils literal">operator|</tt></p>
636 <table class="docutils field-list" frame="void" rules="none">
637 <col class="field-name" />
638 <col class="field-body" />
639 <tbody valign="top">
640 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
641 </tr>
642 </tbody>
643 </table>
644 <pre class="literal-block">
645 template &lt;typename T&gt;
646 constexpr <em>tagged default</em> operator|(T const&amp; x) const;
647
648 template &lt;typename T&gt;
649 constexpr <em>tagged default</em> operator|(T&amp; x) const;
650
651 template &lt;typename T&gt;
652 constexpr <em>tagged default</em> operator|(T const&amp;&amp; x) const;
653
654 template &lt;typename T&gt;
655 constexpr <em>tagged default</em> operator|(T&amp;&amp; x) const;
656 </pre>
657 <table class="docutils field-list" frame="void" rules="none">
658 <col class="field-name" />
659 <col class="field-body" />
660 <tbody valign="top">
661 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">one of the following:</td>
662 </tr>
663 </tbody>
664 </table>
665 <ul class="simple">
666 <li>The nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">forward_reference</tt>.</li>
667 <li>To use the <tt class="docutils literal">const</tt> lvalue reference overload, <tt class="docutils literal">T</tt> must be scalar, or
668 the nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">in_reference</tt>.</li>
669 <li>To use the mutable lvalue reference overload, the nested <tt class="docutils literal">qualifier</tt>
670 type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">out_reference</tt> or <tt class="docutils literal">in_out_reference</tt>, and
671 <tt class="docutils literal">T</tt> must not be <tt class="docutils literal">const</tt>-qualified.</li>
672 <li>To use the <tt class="docutils literal">const</tt> rvalue reference overload for non-scalar <tt class="docutils literal">T</tt>, the
673 nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">in_reference</tt>.</li>
674 <li>To use the mutable rvalue reference overload for non-scalar <tt class="docutils literal">T</tt>, the
675 nested <tt class="docutils literal">qualifier</tt> type of <tt class="docutils literal">Tag</tt> must be <tt class="docutils literal">consume_reference</tt> or
676 <tt class="docutils literal">move_from_reference</tt>.</li>
677 </ul>
678 <table class="docutils field-list" frame="void" rules="none">
679 <col class="field-name" />
680 <col class="field-body" />
681 <tbody valign="top">
682 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">a <a class="reference internal" href="#tagged-default">tagged default</a> with <em>value</em> <tt class="docutils literal">x</tt> and <a class="reference internal" href="#kw">keyword</a> <tt class="docutils literal">Tag</tt>.</td>
683 </tr>
684 </tbody>
685 </table>
686 <p id="logical-or-operator"><tt class="docutils literal">operator||</tt></p>
687 <table class="docutils field-list" frame="void" rules="none">
688 <col class="field-name" />
689 <col class="field-body" />
690 <tbody valign="top">
691 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
692 </tr>
693 </tbody>
694 </table>
695 <pre class="literal-block">
696 template &lt;typename F&gt;
697 constexpr <em>tagged lazy default</em> operator||(F const&amp; g) const;
698
699 template &lt;typename F&gt;
700 constexpr <em>tagged lazy default</em> operator||(F&amp; g) const;
701 </pre>
702 <table class="docutils field-list" frame="void" rules="none">
703 <col class="field-name" />
704 <col class="field-body" />
705 <tbody valign="top">
706 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">g()</tt> must be valid, with type
707 <a class="reference external" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">boost::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="id6"><sup>2</sup></a></td>
708 </tr>
709 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">a <a class="reference internal" href="#tagged-lazy-default">tagged lazy default</a> with <em>value</em> <tt class="docutils literal">g</tt> and <a class="reference internal" href="#kw">keyword</a> <tt class="docutils literal">Tag</tt>.</td>
710 </tr>
711 </tbody>
712 </table>
713 <p id="instance"><tt class="docutils literal">instance</tt></p>
714 <table class="docutils field-list" frame="void" rules="none">
715 <col class="field-name" />
716 <col class="field-body" />
717 <tbody valign="top">
718 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
719 </tr>
720 </tbody>
721 </table>
722 <pre class="literal-block">
723 static keyword&lt;Tag&gt; const&amp; instance;
724 </pre>
725 <table class="docutils field-list" frame="void" rules="none">
726 <col class="field-name" />
727 <col class="field-body" />
728 <tbody valign="top">
729 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">a “singleton instance”: the same object will be returned on each
730 invocation of <tt class="docutils literal">instance</tt>.</td>
731 </tr>
732 <tr class="field"><th class="field-name">Thread Safety:</th><td class="field-body"><tt class="docutils literal">instance</tt> can be accessed from multiple threads simultaneously.</td>
733 </tr>
734 </tbody>
735 </table>
736 <p id="get"><tt class="docutils literal">get</tt></p>
737 <table class="docutils field-list" frame="void" rules="none">
738 <col class="field-name" />
739 <col class="field-body" />
740 <tbody valign="top">
741 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
742 </tr>
743 </tbody>
744 </table>
745 <pre class="literal-block">
746 static keyword&lt;Tag&gt;&amp; get();
747 </pre>
748 <div class="admonition-deprecated admonition">
749 <p class="first admonition-title">Deprecated</p>
750 <p class="last">This function has been deprecated in favor of <tt class="docutils literal">instance</tt>.</p>
751 </div>
752 <table class="docutils field-list" frame="void" rules="none">
753 <col class="field-name" />
754 <col class="field-body" />
755 <tbody valign="top">
756 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">a “singleton instance”: the same object will be returned on each
757 invocation of <tt class="docutils literal">get()</tt>.</td>
758 </tr>
759 <tr class="field"><th class="field-name">Thread Safety:</th><td class="field-body"><tt class="docutils literal">get()</tt> can be called from multiple threads simultaneously.</td>
760 </tr>
761 </tbody>
762 </table>
763 </div>
764 <div class="section" id="id7">
765 <span id="template-keyword"></span><h2><a class="toc-backref" href="#id42">4.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">template_keyword</tt></a></h2>
766 <p>This class template encapsulates a named template parameter.  Every type
767 generated by the <a class="reference internal" href="#boost-parameter-template-keyword"><tt class="docutils literal">BOOST_PARAMETER_TEMPLATE_KEYWORD</tt></a> macro is a specialization
768 of <tt class="docutils literal">template_keyword</tt>.</p>
769 <table class="docutils field-list" frame="void" rules="none">
770 <col class="field-name" />
771 <col class="field-body" />
772 <tbody valign="top">
773 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/template_keyword.hpp">boost/parameter/template_keyword.hpp</a></td>
774 </tr>
775 </tbody>
776 </table>
777 <pre class="literal-block">
778 template &lt;typename Tag, typename T&gt;
779 struct template_keyword
780 {
781     typedef Tag key_type;
782     typedef T value_type;
783     typedef <em>implementation defined</em> reference;
784 };
785 </pre>
786 <p>The <a class="reference external" href="../../test/ntp.cpp">test/ntp.cpp</a> test program demonstrates proper usage of this class template.</p>
787 </div>
788 <div class="section" id="id8">
789 <span id="parameters"></span><h2><a class="toc-backref" href="#id43">4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">parameters</tt></a></h2>
790 <p>Provides an interface for assembling the actual arguments to a <cite>forwarding
791 function</cite> into an <span class="concept">ArgumentPack</span>, in which any <a class="reference internal" href="#positional">positional</a> arguments will be
792 tagged according to the corresponding template argument to <tt class="docutils literal">parameters</tt>.</p>
793 <table class="docutils field-list" frame="void" rules="none">
794 <col class="field-name" />
795 <col class="field-body" />
796 <tbody valign="top">
797 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/parameters.hpp">boost/parameter/parameters.hpp</a></td>
798 </tr>
799 </tbody>
800 </table>
801 <pre class="literal-block">
802 template &lt;typename ...PSpec&gt;
803 struct parameters
804 {
805     template &lt;typename ...Args&gt;
806     struct <a class="reference internal" href="#match"><tt class="docutils literal">match</tt></a>
807     {
808         typedef … type;
809     };
810
811     template &lt;typename ...Args&gt;
812     <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> <a class="reference internal" href="#function-call-operator"><tt class="docutils literal">operator()</tt></a>(Args&amp;&amp;... args) const;
813 };
814 </pre>
815 <table class="docutils field-list" frame="void" rules="none">
816 <col class="field-name" />
817 <col class="field-body" />
818 <tbody valign="top">
819 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">Each element in the <tt class="docutils literal">PSpec</tt> parameter pack must be a model of
820 <a class="reference internal" href="#parameterspec"><span class="concept">ParameterSpec</span></a>.</td>
821 </tr>
822 </tbody>
823 </table>
824 <div class="note">
825 <p class="first admonition-title">Note</p>
826 <p>In this section, <tt class="docutils literal">R</tt> ## <em>i</em> and <tt class="docutils literal">K</tt> ## <em>i</em> are defined as
827 follows, for any argument type <tt class="docutils literal">A</tt> ## <em>i</em>:</p>
828 <div class="last line-block">
829 <div class="line">let <tt class="docutils literal">D0</tt> the set [d0, …, d ## <em>j</em>] of all <strong>deduced</strong></div>
830 <div class="line"><em>parameter specs</em> in the <tt class="docutils literal">PSpec</tt> parameter pack</div>
831 <div class="line"><tt class="docutils literal">R</tt> ## <em>i</em> is the <a class="reference internal" href="#intended-argument-type">intended argument type</a> of <tt class="docutils literal">A</tt> ## <em>i</em></div>
832 <div class="line"><br /></div>
833 <div class="line">if <tt class="docutils literal">A</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 internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a></div>
834 <div class="line">then</div>
835 <div class="line-block">
836 <div class="line"><tt class="docutils literal">K</tt> ## <em>i</em> is <tt class="docutils literal">T</tt></div>
837 </div>
838 <div class="line">else</div>
839 <div class="line-block">
840 <div class="line">if some <tt class="docutils literal">A</tt> ## <em>j</em> where <em>j</em> ≤ <em>i</em> is a result type of</div>
841 <div class="line"><tt class="docutils literal"><span class="pre">keyword&lt;T&gt;::</span></tt> <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a></div>
842 <div class="line"><em>or</em> some <tt class="docutils literal">P</tt> ## <em>j</em> in <em>j</em> ≤ <em>i</em> is <strong>deduced</strong></div>
843 <div class="line">then</div>
844 <div class="line-block">
845 <div class="line">if some <em>parameter spec</em> <tt class="docutils literal">d</tt> ## <em>j</em> in <tt class="docutils literal">D</tt> ## <em>i</em></div>
846 <div class="line">matches <tt class="docutils literal">A</tt> ## <em>i</em></div>
847 <div class="line">then</div>
848 <div class="line-block">
849 <div class="line"><tt class="docutils literal">K</tt> ## <em>i</em> is the <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> of <tt class="docutils literal">d</tt> ## <em>j</em>.</div>
850 <div class="line"><tt class="docutils literal">D</tt><sub>i+1</sub> is <tt class="docutils literal">D</tt> ## <em>i</em> - [ <tt class="docutils literal">d</tt> ## <em>j</em>]</div>
851 </div>
852 </div>
853 <div class="line">else</div>
854 <div class="line-block">
855 <div class="line"><tt class="docutils literal">K</tt> ## <em>i</em> is the <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> of <tt class="docutils literal">P</tt> ## <em>i</em>.</div>
856 </div>
857 </div>
858 </div>
859 </div>
860 <dl class="docutils" id="match">
861 <dt><tt class="docutils literal">match</tt></dt>
862 <dd>A <a class="reference external" href="../../../mpl/doc/refmanual/metafunction.html">Metafunction</a> used to remove a <a class="reference external" href="index.html#forwarding-functions">forwarding function</a> from overload
863 resolution.</dd>
864 </dl>
865 <table class="docutils field-list" frame="void" rules="none">
866 <col class="field-name" />
867 <col class="field-body" />
868 <tbody valign="top">
869 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">if all elements in <tt class="docutils literal"><span class="pre">Params...</span></tt> are <em>satisfied</em> (see below), then
870 <tt class="docutils literal"><span class="pre">parameters&lt;Params...&gt;</span></tt>.  Otherwise, <tt class="docutils literal"><span class="pre">match&lt;Args...&gt;::type</span></tt> is not
871 defined.</td>
872 </tr>
873 </tbody>
874 </table>
875 <p>Each element <tt class="docutils literal">P</tt> in <tt class="docutils literal"><span class="pre">Params...</span></tt> is <strong>satisfied</strong> if either:</p>
876 <ul>
877 <li><p class="first"><tt class="docutils literal">P</tt> is the <em>unspecified</em> default</p>
878 </li>
879 <li><p class="first"><strong>or</strong>, <tt class="docutils literal">P</tt> is a <em>keyword tag type</em></p>
880 </li>
881 <li><dl class="first docutils">
882 <dt><strong>or</strong>, <tt class="docutils literal">P</tt> is <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a> <tt class="docutils literal">&lt;X,F&gt;</tt> and either</dt>
883 <dd><ul class="first last">
884 <li><p class="first"><tt class="docutils literal">X</tt> is not <tt class="docutils literal">K</tt> ## <em>i</em> for any <em>i</em>,</p>
885 </li>
886 <li><dl class="first docutils">
887 <dt><strong>or</strong> <tt class="docutils literal">X</tt> is some <tt class="docutils literal">K</tt> ## <em>i</em>  and <tt class="docutils literal"><span class="pre">mpl::apply&lt;F,R</span></tt> ## <em>i</em></dt>
888 <dd><p class="first last"><tt class="docutils literal"><span class="pre">&gt;::type::value</span></tt> is <tt class="docutils literal">true</tt></p>
889 </dd>
890 </dl>
891 </li>
892 </ul>
893 </dd>
894 </dl>
895 </li>
896 <li><dl class="first docutils">
897 <dt><strong>or</strong>, <tt class="docutils literal">P</tt> is <a class="reference internal" href="#required"><tt class="docutils literal">required</tt></a> <tt class="docutils literal">&lt;X,F&gt;</tt>, and</dt>
898 <dd><ul class="first last simple">
899 <li><tt class="docutils literal">X</tt> is some <tt class="docutils literal">K</tt> ## <em>i</em>, <strong>and</strong></li>
900 <li><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">true</tt></li>
901 </ul>
902 </dd>
903 </dl>
904 </li>
905 </ul>
906 <p id="function-call-operator"><tt class="docutils literal">operator()</tt></p>
907 <table class="docutils field-list" frame="void" rules="none">
908 <col class="field-name" />
909 <col class="field-body" />
910 <tbody valign="top">
911 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
912 </tr>
913 </tbody>
914 </table>
915 <pre class="literal-block">
916 template &lt;typename ...Args&gt;
917 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator()(Args&amp;&amp;... args) const;
918 </pre>
919 <table class="docutils field-list" frame="void" rules="none">
920 <col class="field-name" />
921 <col class="field-body" />
922 <tbody valign="top">
923 <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> containing, for each <tt class="docutils literal">a</tt> ## <em>i</em>,</p>
924 <ul class="last">
925 <li><p class="first">if <tt class="docutils literal">a</tt> ## <em>i</em>  is a single-element <span class="concept">ArgumentPack</span>, its element</p>
926 </li>
927 <li><dl class="first docutils">
928 <dt>Otherwise, a <a class="reference internal" href="#tagged-reference">tagged reference</a> with <a class="reference internal" href="#kw">keyword</a> <tt class="docutils literal">K</tt> ## <em>i</em> and <em>value</em></dt>
929 <dd><p class="first last"><tt class="docutils literal">a</tt> ## <em>i</em></p>
930 </dd>
931 </dl>
932 </li>
933 </ul>
934 </td>
935 </tr>
936 </tbody>
937 </table>
938 </div>
939 <div class="section" id="optional-required">
940 <span id="required"></span><span id="optional"></span><h2><a class="toc-backref" href="#id44">4.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">optional</tt>, <tt class="docutils literal">required</tt></a></h2>
941 <p>These templates describe the requirements on a function parameter.</p>
942 <p><tt class="docutils literal">optional</tt> is defined in: <a class="reference external" href="../../../../boost/parameter/optional.hpp">boost/parameter/optional.hpp</a></p>
943 <p><tt class="docutils literal">required</tt> is defined in: <a class="reference external" href="../../../../boost/parameter/required.hpp">boost/parameter/required.hpp</a></p>
944 <p>Both headers are included by: <a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></p>
945 <table class="docutils field-list" frame="void" rules="none">
946 <col class="field-name" />
947 <col class="field-body" />
948 <tbody valign="top">
949 <tr class="field"><th class="field-name" colspan="2">Specializations model:</th></tr>
950 <tr class="field"><td>&nbsp;</td><td class="field-body"><a class="reference internal" href="#parameterspec"><span class="concept">ParameterSpec</span></a></td>
951 </tr>
952 </tbody>
953 </table>
954 <pre class="literal-block">
955 template &lt;typename Tag, typename Predicate = <em>unspecified</em>&gt;
956 struct optional;
957
958 template &lt;typename Tag, typename Predicate = <em>unspecified</em>&gt;
959 struct required;
960 </pre>
961 <p>The default value of <tt class="docutils literal">Predicate</tt> is an unspecified <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction
962 Class</a> that returns <tt class="docutils literal"><span class="pre">mpl::true_</span></tt> for any argument.  If
963 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined, then the default value of
964 <tt class="docutils literal">Predicate</tt> is also a <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>-style quoted metafunction that returns
965 <tt class="docutils literal"><span class="pre">mp11::mp_true</span></tt> for any argument.</p>
966 </div>
967 <div class="section" id="id9">
968 <span id="deduced"></span><h2><a class="toc-backref" href="#id45">4.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">deduced</tt></a></h2>
969 <p>This template is used to wrap the <em>keyword tag</em> argument to
970 <tt class="docutils literal">optional</tt> or <tt class="docutils literal">required</tt>.</p>
971 <table class="docutils field-list" frame="void" rules="none">
972 <col class="field-name" />
973 <col class="field-body" />
974 <tbody valign="top">
975 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/deduced.hpp">boost/parameter/deduced.hpp</a></td>
976 </tr>
977 <tr class="field"><th class="field-name">Included by:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
978 </tr>
979 </tbody>
980 </table>
981 <pre class="literal-block">
982 template &lt;typename Tag&gt;
983 struct deduced;
984 </pre>
985 <table class="docutils field-list" frame="void" rules="none">
986 <col class="field-name" />
987 <col class="field-body" />
988 <tbody valign="top">
989 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">nothing</td>
990 </tr>
991 </tbody>
992 </table>
993 </div>
994 </div>
995 <hr class="docutils" />
996 <div class="section" id="metafunctions">
997 <h1><a class="toc-backref" href="#id46">5&nbsp;&nbsp;&nbsp;Metafunctions</a></h1>
998 <p>A <a class="reference external" href="../../../mpl/doc/refmanual/metafunction.html">Metafunction</a> is conceptually a function that operates on, and returns,
999 C++ types.</p>
1000 <div class="section" id="id10">
1001 <span id="binding"></span><h2><a class="toc-backref" href="#id47">5.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">binding</tt></a></h2>
1002 <p>Returns the result type of indexing an argument pack with a
1003 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> or with a <a class="reference internal" href="#tagged-default">tagged default</a>.</p>
1004 <table class="docutils field-list" frame="void" rules="none">
1005 <col class="field-name" />
1006 <col class="field-body" />
1007 <tbody valign="top">
1008 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/binding.hpp">boost/parameter/binding.hpp</a></td>
1009 </tr>
1010 </tbody>
1011 </table>
1012 <pre class="literal-block">
1013 template &lt;typename A, typename K, typename D = void_&gt;
1014 struct binding
1015 {
1016     typedef … type;
1017 };
1018 </pre>
1019 <table class="docutils field-list" frame="void" rules="none">
1020 <col class="field-name" />
1021 <col class="field-body" />
1022 <tbody valign="top">
1023 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">A</tt> must be a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</td>
1024 </tr>
1025 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">the reference type of the <a class="reference internal" href="#tagged-reference">tagged reference</a> in <tt class="docutils literal">A</tt> having
1026 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal">K</tt>, if any.  If no such <a class="reference internal" href="#tagged-reference">tagged reference</a> exists,
1027 returns <tt class="docutils literal">D</tt>.</td>
1028 </tr>
1029 </tbody>
1030 </table>
1031 </div>
1032 <div class="section" id="id11">
1033 <span id="lazy-binding"></span><h2><a class="toc-backref" href="#id48">5.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">lazy_binding</tt></a></h2>
1034 <p>Returns the result type of indexing an argument pack with a
1035 <a class="reference internal" href="#tagged-lazy-default">tagged lazy default</a>.</p>
1036 <table class="docutils field-list" frame="void" rules="none">
1037 <col class="field-name" />
1038 <col class="field-body" />
1039 <tbody valign="top">
1040 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/binding.hpp">boost/parameter/binding.hpp</a></td>
1041 </tr>
1042 </tbody>
1043 </table>
1044 <pre class="literal-block">
1045 template &lt;typename A, typename K, typename F&gt;
1046 struct lazy_binding
1047 {
1048     typedef … type;
1049 };
1050 </pre>
1051 <table class="docutils field-list" frame="void" rules="none">
1052 <col class="field-name" />
1053 <col class="field-body" />
1054 <tbody valign="top">
1055 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">A</tt> must be a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</td>
1056 </tr>
1057 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">the reference type of the <a class="reference internal" href="#tagged-reference">tagged reference</a> in <tt class="docutils literal">A</tt> having
1058 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal">K</tt>, if any.  If no such <a class="reference internal" href="#tagged-reference">tagged reference</a> exists,
1059 returns <a class="reference external" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">boost::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="id12"><sup>2</sup></a></td>
1060 </tr>
1061 </tbody>
1062 </table>
1063 </div>
1064 <div class="section" id="id13">
1065 <span id="value-type"></span><h2><a class="toc-backref" href="#id49">5.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">value_type</tt></a></h2>
1066 <p>Returns the result type of indexing an argument pack with a
1067 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> or with a <a class="reference internal" href="#tagged-default">tagged default</a>.</p>
1068 <table class="docutils field-list" frame="void" rules="none">
1069 <col class="field-name" />
1070 <col class="field-body" />
1071 <tbody valign="top">
1072 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/value_type.hpp">boost/parameter/value_type.hpp</a></td>
1073 </tr>
1074 </tbody>
1075 </table>
1076 <pre class="literal-block">
1077 template &lt;typename A, typename K, typename D = void_&gt;
1078 struct value_type
1079 {
1080     typedef … type;
1081 };
1082 </pre>
1083 <table class="docutils field-list" frame="void" rules="none">
1084 <col class="field-name" />
1085 <col class="field-body" />
1086 <tbody valign="top">
1087 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><p class="first"><tt class="docutils literal">A</tt> must be a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</p>
1088 </td>
1089 </tr>
1090 <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the (possibly const-qualified) type of the <a class="reference internal" href="#tagged-reference">tagged reference</a> in
1091 <tt class="docutils literal">A</tt> having <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal">K</tt>, if any.  If no such
1092 <a class="reference internal" href="#tagged-reference">tagged reference</a> exists, returns <tt class="docutils literal">D</tt>.  Equivalent to:</p>
1093 <pre class="literal-block">
1094 typename <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/remove_reference.html">boost::remove_reference</a>&lt;
1095     typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;A, K, D&gt;::type
1096 &gt;::type
1097 </pre>
1098 <p class="last">… when <tt class="docutils literal">D</tt> is not a reference type.</p>
1099 </td>
1100 </tr>
1101 </tbody>
1102 </table>
1103 </div>
1104 <div class="section" id="id14">
1105 <span id="lazy-value-type"></span><h2><a class="toc-backref" href="#id50">5.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">lazy_value_type</tt></a></h2>
1106 <p>Returns the result type of indexing an argument pack with a
1107 <a class="reference internal" href="#tagged-lazy-default">tagged lazy default</a>.</p>
1108 <table class="docutils field-list" frame="void" rules="none">
1109 <col class="field-name" />
1110 <col class="field-body" />
1111 <tbody valign="top">
1112 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/value_type.hpp">boost/parameter/value_type.hpp</a></td>
1113 </tr>
1114 </tbody>
1115 </table>
1116 <pre class="literal-block">
1117 template &lt;typename A, typename K, typename F&gt;
1118 struct lazy_value_type
1119 {
1120     typedef … type;
1121 };
1122 </pre>
1123 <table class="docutils field-list" frame="void" rules="none">
1124 <col class="field-name" />
1125 <col class="field-body" />
1126 <tbody valign="top">
1127 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">A</tt> must be a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</td>
1128 </tr>
1129 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">the (possibly const-qualified) type of the <a class="reference internal" href="#tagged-reference">tagged reference</a> in
1130 <tt class="docutils literal">A</tt> having <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> <tt class="docutils literal">K</tt>, if any.  If no such
1131 <a class="reference internal" href="#tagged-reference">tagged reference</a> exists, returns
1132 <a class="reference external" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">boost::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="id15"><sup>2</sup></a></td>
1133 </tr>
1134 </tbody>
1135 </table>
1136 </div>
1137 <div class="section" id="id16">
1138 <span id="are-tagged-arguments"></span><h2><a class="toc-backref" href="#id51">5.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">are_tagged_arguments</tt></a></h2>
1139 <table class="docutils field-list" frame="void" rules="none">
1140 <col class="field-name" />
1141 <col class="field-body" />
1142 <tbody valign="top">
1143 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/are_tagged_arguments.hpp">boost/parameter/are_tagged_arguments.hpp</a></td>
1144 </tr>
1145 </tbody>
1146 </table>
1147 <pre class="literal-block">
1148 template &lt;typename T0, typename ...Pack&gt;
1149 struct are_tagged_arguments
1150     // : <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> if T0 and all elements in Pack are
1151     // tagged reference types, <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> otherwise.
1152 {
1153 };
1154 </pre>
1155 <table class="docutils field-list" frame="void" rules="none">
1156 <col class="field-name" />
1157 <col class="field-body" />
1158 <tbody valign="top">
1159 <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">mpl::true_</span></tt> if <tt class="docutils literal">T0</tt> and all elements in parameter pack <tt class="docutils literal">Pack</tt> are
1160 <a class="reference internal" href="#tagged-reference">tagged reference</a> types, <tt class="docutils literal"><span class="pre">mpl::false_</span></tt> otherwise.</td>
1161 </tr>
1162 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1163 </tr>
1164 </tbody>
1165 </table>
1166 <p>When implementing a Boost.Parameter-enabled constructor for a container that
1167 conforms to the C++ standard, one needs to remember that the standard requires
1168 the presence of other constructors that are typically defined as templates,
1169 such as range constructors.  To avoid overload ambiguities between the two
1170 constructors, use this metafunction in conjunction with <tt class="docutils literal">disable_if</tt> to
1171 define the range constructor.</p>
1172 <pre class="literal-block">
1173 template &lt;typename B&gt;
1174 class frontend : public B
1175 {
1176     struct _enabler
1177     {
1178     };
1179
1180  public:
1181     <a class="reference internal" href="#boost-parameter-no-spec-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR</tt></a>(frontend, (B))
1182
1183     template &lt;typename Iterator&gt;
1184     frontend(
1185         Iterator itr
1186       , Iterator itr_end
1187       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>&lt;
1188             are_tagged_arguments&lt;Iterator&gt;
1189           , _enabler
1190         &gt;::type = _enabler()
1191     ) : B(itr, itr_end)
1192     {
1193     }
1194 };
1195 </pre>
1196 </div>
1197 <div class="section" id="id17">
1198 <span id="is-argument-pack"></span><h2><a class="toc-backref" href="#id52">5.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">is_argument_pack</tt></a></h2>
1199 <table class="docutils field-list" frame="void" rules="none">
1200 <col class="field-name" />
1201 <col class="field-body" />
1202 <tbody valign="top">
1203 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/is_argument_pack.hpp">boost/parameter/is_argument_pack.hpp</a></td>
1204 </tr>
1205 </tbody>
1206 </table>
1207 <pre class="literal-block">
1208 template &lt;typename T&gt;
1209 struct is_argument_pack
1210     // : <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> if T is a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>,
1211     // <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> otherwise.
1212 {
1213 };
1214 </pre>
1215 <table class="docutils field-list" frame="void" rules="none">
1216 <col class="field-name" />
1217 <col class="field-body" />
1218 <tbody valign="top">
1219 <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">mpl::true_</span></tt> if <tt class="docutils literal">T</tt> is a model of <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, <tt class="docutils literal"><span class="pre">mpl::false_</span></tt>
1220 otherwise.</td>
1221 </tr>
1222 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1223 </tr>
1224 </tbody>
1225 </table>
1226 <p>To avoid overload ambiguities between a constructor that takes in an
1227 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> and a templated conversion constructor, use this
1228 metafunction in conjunction with <tt class="docutils literal">enable_if</tt>.</p>
1229 <pre class="literal-block">
1230 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a0)
1231
1232 template &lt;typename T&gt;
1233 class backend0
1234 {
1235     struct _enabler
1236     {
1237     };
1238
1239     T a0;
1240
1241  public:
1242     template &lt;typename ArgPack&gt;
1243     explicit backend0(
1244         ArgPack const&amp; args
1245       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
1246             is_argument_pack&lt;ArgPack&gt;
1247           , _enabler
1248         &gt;::type = _enabler()
1249     ) : a0(args[_a0])
1250     {
1251     }
1252
1253     template &lt;typename U&gt;
1254     backend0(
1255         backend0&lt;U&gt; const&amp; copy
1256       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
1257             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a>&lt;U,T&gt;
1258           , _enabler
1259         &gt;::type = _enabler()
1260     ) : a0(copy.get_a0())
1261     {
1262     }
1263
1264     T const&amp; get_a0() const
1265     {
1266         return this-&gt;a0;
1267     }
1268 };
1269 </pre>
1270 </div>
1271 <div class="section" id="id18">
1272 <span id="result-of-compose"></span><h2><a class="toc-backref" href="#id53">5.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal"><span class="pre">result_of::compose</span></tt></a></h2>
1273 <p>Returns the result type of the <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a> function.</p>
1274 <table class="docutils field-list" frame="void" rules="none">
1275 <col class="field-name" />
1276 <col class="field-body" />
1277 <tbody valign="top">
1278 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/compose.hpp">boost/parameter/compose.hpp</a></td>
1279 </tr>
1280 </tbody>
1281 </table>
1282 <pre class="literal-block">
1283 template &lt;typename ...TaggedArgs&gt;
1284 struct compose
1285   : <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
1286         <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;T0,Pack...&gt;
1287       , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
1288     &gt;
1289 {
1290 };
1291
1292 template &lt;&gt;
1293 struct compose&lt;&gt;
1294 {
1295     typedef <em>empty</em> <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type;
1296 };
1297 </pre>
1298 <table class="docutils field-list" frame="void" rules="none">
1299 <col class="field-name" />
1300 <col class="field-body" />
1301 <tbody valign="top">
1302 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">All elements in <tt class="docutils literal">TaggedArgs</tt> must be <a class="reference internal" href="#tagged-reference">tagged reference</a> types, if
1303 specified.</td>
1304 </tr>
1305 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">the result type of the <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a> function.</td>
1306 </tr>
1307 </tbody>
1308 </table>
1309 </div>
1310 </div>
1311 <hr class="docutils" />
1312 <div class="section" id="function-templates">
1313 <h1><a class="toc-backref" href="#id54">6&nbsp;&nbsp;&nbsp;Function Templates</a></h1>
1314 <div class="section" id="id19">
1315 <span id="compose"></span><h2><a class="toc-backref" href="#id55">6.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">compose</tt></a></h2>
1316 <table class="docutils field-list" frame="void" rules="none">
1317 <col class="field-name" />
1318 <col class="field-body" />
1319 <tbody valign="top">
1320 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/compose.hpp">boost/parameter/compose.hpp</a></td>
1321 </tr>
1322 </tbody>
1323 </table>
1324 <pre class="literal-block">
1325 template &lt;typename ...Pack&gt;
1326 constexpr typename <a class="reference internal" href="#result-of-compose"><tt class="docutils literal"><span class="pre">result_of::compose</span></tt></a>&lt;Pack...&gt;::type
1327     compose(Pack const&amp;... args);
1328 </pre>
1329 <p>This function facilitates easier variadic argument composition.  It is used by
1330 the <a class="reference internal" href="#boost-parameter-no-spec-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION</tt></a>,
1331 <a class="reference internal" href="#boost-parameter-no-spec-member-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION</tt></a>,
1332 <a class="reference internal" href="#boost-parameter-no-spec-const-member-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION</tt></a>,
1333 <a class="reference internal" href="#boost-parameter-no-spec-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR</tt></a>,
1334 <a class="reference internal" href="#boost-parameter-no-spec-const-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR</tt></a>,
1335 <a class="reference internal" href="#boost-parameter-no-spec-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR</tt></a>, and
1336 <a class="reference internal" href="#boost-parameter-no-spec-no-base-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR</tt></a> code generation macros.  You
1337 can use it to write your own code generation macros if the ones provided by
1338 this library do not suffice.</p>
1339 <p>Unlike the <a class="reference internal" href="#tagged-reference">tagged reference</a> comma operator, the <tt class="docutils literal">compose()</tt> function is
1340 variadic, as mentioned before.  However, the <a class="reference internal" href="#tagged-reference">tagged reference</a> comma operator
1341 can be invoked indefinitely and therefore does not limit the size of the
1342 resulting <span class="concept">ArgumentPack</span>, while the <tt class="docutils literal">compose()</tt> function cannot take in more
1343 than <a class="reference internal" href="#boost-parameter-compose-max-arity"><tt class="docutils literal">BOOST_PARAMETER_COMPOSE_MAX_ARITY</tt></a> arguments for compilers that do not
1344 support perfect forwarding.</p>
1345 <table class="docutils field-list" frame="void" rules="none">
1346 <col class="field-name" />
1347 <col class="field-body" />
1348 <tbody valign="top">
1349 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">All elements in <tt class="docutils literal">args</tt> must be <a class="reference internal" href="#tagged-reference">tagged reference</a> objects, if
1350 specified.</td>
1351 </tr>
1352 <tr class="field"><th class="field-name">Returns:</th><td class="field-body">an <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> containing all elements in <tt class="docutils literal">args</tt>, if
1353 specified; an empty <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> otherwise.</td>
1354 </tr>
1355 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1356 </tr>
1357 </tbody>
1358 </table>
1359 <pre class="literal-block">
1360 BOOST_PARAMETER_NAME(index)
1361 BOOST_PARAMETER_NAME(name)
1362
1363 template &lt;typename ArgumentPack&gt;
1364 int print_name_and_index(ArgumentPack const&amp; args)
1365 {
1366     std::cout &lt;&lt; &quot;index = &quot; &lt;&lt; args[_index];
1367     std::cout &lt;&lt; &quot;name = &quot; &lt;&lt; args[_name];
1368     std::cout &lt;&lt; &quot;; &quot; &lt;&lt; std::endl;
1369     return 0;
1370 }
1371
1372 int y = print_name_and_index(compose(_index = 3, _name = &quot;jones&quot;));
1373 </pre>
1374 <p>The <a class="reference external" href="../../test/compose.cpp">compose.cpp</a> test program shows more examples using this function.</p>
1375 </div>
1376 </div>
1377 <hr class="docutils" />
1378 <div class="section" id="code-generation-macros">
1379 <h1><a class="toc-backref" href="#id56">7&nbsp;&nbsp;&nbsp;Code Generation Macros</a></h1>
1380 <p>Macros in this section can be used to ease the writing of code
1381 using the Parameter library by eliminating repetitive boilerplate.</p>
1382 <div class="section" id="boost-parameter-function-result-name-tag-namespace-arguments">
1383 <span id="boost-parameter-function"></span><h2><a class="toc-backref" href="#id57">7.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, arguments)</tt></a></h2>
1384 <table class="docutils field-list" frame="void" rules="none">
1385 <col class="field-name" />
1386 <col class="field-body" />
1387 <tbody valign="top">
1388 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
1389 </tr>
1390 </tbody>
1391 </table>
1392 <p>Generates a function that can take in positional arguments, composed
1393 arguments, named arguments, and deduced arguments.</p>
1394 <table class="docutils field-list" frame="void" rules="none">
1395 <col class="field-name" />
1396 <col class="field-body" />
1397 <tbody valign="top">
1398 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1399 </tr>
1400 </tbody>
1401 </table>
1402 <p>The return type of each of the following function templates falls under a
1403 different value category.</p>
1404 <pre class="literal-block">
1405 template &lt;std::size_t N&gt;
1406 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
1407 {
1408     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1409 }
1410
1411 template &lt;std::size_t N&gt;
1412 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
1413 {
1414     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1415 }
1416
1417 template &lt;std::size_t N&gt;
1418 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
1419 {
1420     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1421     return lset;
1422 }
1423
1424 template &lt;std::size_t N&gt;
1425 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
1426 {
1427     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1428     return clset;
1429 }
1430 </pre>
1431 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
1432 to return the correct value category when passed in an object returned by one
1433 of the functions defined above.  Assume that
1434 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
1435 <pre class="literal-block">
1436 enum invoked
1437 {
1438     passed_by_lvalue_reference_to_const
1439   , passed_by_lvalue_reference
1440   , passed_by_rvalue_reference_to_const
1441   , passed_by_rvalue_reference
1442 };
1443
1444 struct U
1445 {
1446     template &lt;std::size_t N&gt;
1447     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
1448     {
1449         return passed_by_lvalue_reference_to_const;
1450     }
1451
1452     template &lt;std::size_t N&gt;
1453     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
1454     {
1455         return passed_by_lvalue_reference;
1456     }
1457
1458     template &lt;std::size_t N&gt;
1459     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
1460     {
1461         return passed_by_rvalue_reference_to_const;
1462     }
1463
1464     template &lt;std::size_t N&gt;
1465     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
1466     {
1467         return passed_by_rvalue_reference;
1468     }
1469 };
1470 </pre>
1471 <p>Define the named parameters that will comprise the argument specification that
1472 this macro will use.  Ensure that all their tag types are in the same
1473 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
1474 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
1475 same argument to which the corresponding named parameter (without underscores)
1476 is bound, as will be shown later.</p>
1477 <pre class="literal-block">
1478 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
1479 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
1480 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
1481 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
1482 </pre>
1483 <p>Use the macro as a substitute for a normal function header.  Enclose the
1484 return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter, also enclose the
1485 expected value type in parentheses.  Since the value types are mutually
1486 exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
1487 clause.  Otherwise, just as with a normal function, the order in which you
1488 specify the parameters determines their position.  Also, just as with a normal
1489 function, optional parameters have default values, whereas required parameters
1490 do not.  Within the function body, either simply use the parameter name or
1491 pass the matching identifier with the leading underscore to the bracket
1492 operator of <tt class="docutils literal">args</tt> to extract the corresponding argument.  Note that the
1493 second method doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to preserve value categories.</p>
1494 <pre class="literal-block">
1495 BOOST_PARAMETER_FUNCTION((bool), evaluate, kw,
1496     (deduced
1497         (required
1498             (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
1499             (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
1500         )
1501         (optional
1502             (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;), rvalue_const_bitset&lt;2&gt;())
1503             (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;), rvalue_bitset&lt;3&gt;())
1504         )
1505     )
1506 )
1507 {
1508     BOOST_TEST_EQ(
1509         passed_by_lvalue_reference_to_const
1510       , U::evaluate_category&lt;0&gt;(lrc)
1511     );
1512     BOOST_TEST_EQ(
1513         passed_by_lvalue_reference
1514       , U::evaluate_category&lt;1&gt;(lr)
1515     );
1516     BOOST_TEST_EQ(
1517         passed_by_rvalue_reference_to_const
1518       , U::evaluate_category&lt;2&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;rrc0_type&gt;(rrc0))
1519     );
1520     BOOST_TEST_EQ(
1521         passed_by_rvalue_reference
1522       , U::evaluate_category&lt;3&gt;(args[_rr0])
1523     );
1524
1525     return true;
1526 }
1527 </pre>
1528 <p>The following function calls are legal.</p>
1529 <pre class="literal-block">
1530 evaluate(  // positional arguments
1531     lvalue_const_bitset&lt;0&gt;()
1532   , lvalue_bitset&lt;1&gt;()
1533   , rvalue_const_bitset&lt;2&gt;()
1534   , rvalue_bitset&lt;3&gt;()
1535 );
1536 evaluate(  // positional arguments
1537     lvalue_const_bitset&lt;0&gt;()
1538   , lvalue_bitset&lt;1&gt;()
1539 );
1540 evaluate((  // composed arguments
1541     _rr0 = rvalue_bitset&lt;3&gt;()
1542   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
1543   , _lr0 = lvalue_bitset&lt;1&gt;()
1544   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
1545 ));
1546 evaluate(  // named arguments
1547     _rr0 = rvalue_bitset&lt;3&gt;()
1548   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
1549   , _lr0 = lvalue_bitset&lt;1&gt;()
1550   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
1551 );
1552 evaluate(  // named arguments
1553     _lr0 = lvalue_bitset&lt;1&gt;()
1554   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
1555 );
1556 </pre>
1557 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
1558 function calls are also legal.</p>
1559 <pre class="literal-block">
1560 evaluate(  // deduced arguments
1561     rvalue_bitset&lt;3&gt;()
1562   , lvalue_const_bitset&lt;0&gt;()
1563   , lvalue_bitset&lt;1&gt;()
1564   , rvalue_const_bitset&lt;2&gt;()
1565 );
1566 evaluate(  // deduced arguments
1567     lvalue_bitset&lt;1&gt;()
1568   , lvalue_const_bitset&lt;0&gt;()
1569 );
1570 </pre>
1571 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a>, <a class="reference external" href="../../test/preprocessor_deduced.cpp">preprocessor_deduced.cpp</a>, and
1572 <a class="reference external" href="../../test/preprocessor_eval_category.cpp">preprocessor_eval_category.cpp</a> test programs demonstrate proper usage of this
1573 macro.</p>
1574 <p><strong>Macro parameters:</strong></p>
1575 <ul class="simple">
1576 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
1577 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
1578 generated forwarding functions.</li>
1579 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
1580 function resides.</li>
1581 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
1582 <em>argument-specifiers</em>, as defined below.</li>
1583 </ul>
1584 <p><strong>Argument specifiers syntax:</strong></p>
1585 <pre class="literal-block">
1586 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
1587
1588 specifier-group0 ::= <em>specifier-group1</em> |
1589     (
1590         '<strong>(</strong>' '<strong>deduced</strong>'
1591             <em>specifier-group1</em> {<em>specifier-group1</em>}
1592         '<strong>)</strong>'
1593     )
1594
1595 specifier-group1 ::=
1596     (
1597         '<strong>(</strong>' '<strong>optional</strong>'
1598             <em>optional-specifier</em> {<em>optional-specifier</em>}
1599         '<strong>)</strong>'
1600     ) | (
1601         '<strong>(</strong>' '<strong>required</strong>'
1602             <em>required-specifier</em> {<em>required-specifier</em>}
1603         '<strong>)</strong>'
1604     )
1605
1606 optional-specifier ::=
1607     '<strong>(</strong>'
1608         <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
1609     ')'
1610
1611 required-specifier ::=
1612     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
1613
1614 restriction ::=
1615     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
1616     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
1617     '<strong>*</strong>'
1618 </pre>
1619 <ul class="simple">
1620 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
1621 <li><tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid C++ expression; if necessary, user code can
1622 compute it in terms of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>, where <tt class="docutils literal"><span class="pre">previous-name</span></tt>
1623 is the <tt class="docutils literal"><span class="pre">argument-name</span></tt> in a previous <tt class="docutils literal"><span class="pre">specifier-group0</span></tt> or
1624 <tt class="docutils literal"><span class="pre">specifier-group1</span></tt>.  <em>This expression will be invoked exactly once.</em></li>
1625 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
1626 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
1627 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
1628 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
1629 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
1630 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
1631 Metafunction Class</a> whose first argument will be the type of the
1632 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
1633 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.  If
1634 <tt class="docutils literal">restriction</tt> uses this form, then the type of the generated name
1635 <tt class="docutils literal"><span class="pre">argument-name</span> ## _type</tt> will be computed in terms of the <strong>target
1636 type</strong>, and the generated reference <tt class="docutils literal"><span class="pre">argument-name</span></tt> (but not its
1637 corresponding entry in <tt class="docutils literal">args</tt>) will be cast to that type.</li>
1638 </ul>
1639 <p><strong>Approximate expansion:</strong></p>
1640 <p>Where:</p>
1641 <ul class="simple">
1642 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
1643 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
1644 </ul>
1645 <pre class="literal-block">
1646 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
1647 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
1648 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
1649 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
1650 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
1651 template &lt;typename Args&gt;
1652 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
1653
1654 // If <strong>result</strong> is a simple return type:
1655 template &lt;typename Args&gt;
1656 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
1657 {
1658     typedef <strong>result</strong> type;
1659 };
1660
1661 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
1662   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
1663         <em>list of parameter specifications, based on arguments</em>
1664     &gt;
1665 {
1666 };
1667
1668 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
1669     boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
1670
1671 template &lt;typename Args&gt;
1672 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
1673     boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const&amp;);
1674
1675 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
1676 <strong>result</strong> <strong>name</strong>(
1677     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
1678   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
1679     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
1680     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
1681 )
1682 {
1683     return boost_param_impl ## __LINE__ ## <strong>name</strong>(
1684         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
1685             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
1686           , …
1687           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
1688         )
1689     );
1690 }
1691
1692 <span class="vellipsis">⋮</span>
1693
1694 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
1695 <strong>result</strong> <strong>name</strong>(
1696     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
1697   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
1698     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
1699     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
1700 )
1701 {
1702     return boost_param_impl ## __LINE__ ## <strong>name</strong>(
1703         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
1704             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
1705           , …
1706           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
1707         )
1708     );
1709 }
1710
1711 template &lt;
1712     typename ResultType
1713   , typename Args
1714   , typename <em>argument name</em> ## <strong>0</strong> ## _type
1715   , …
1716   , typename <em>argument name</em> ## <strong>n</strong> ## _type
1717 &gt;
1718 ResultType
1719     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1720         (ResultType(*)())
1721       , Args const&amp; args
1722       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
1723       , …
1724       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
1725     );
1726
1727 <span class="vellipsis">⋮</span>
1728
1729 template &lt;
1730     typename ResultType
1731   , typename Args
1732   , typename <em>argument name</em> ## <strong>0</strong> ## _type
1733   , …
1734   , typename <em>argument name</em> ## <strong>m</strong> ## _type
1735 &gt;
1736 ResultType
1737     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1738         (ResultType(*)())
1739       , Args const&amp; args
1740       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
1741       , …
1742       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
1743     );
1744
1745 template &lt;typename Args&gt;
1746 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
1747     boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const&amp; args)
1748 {
1749     return boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1750         static_cast&lt;
1751             typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;
1752                 Args
1753             &gt;::type(*)()
1754         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
1755       , args
1756       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
1757             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
1758                 Args
1759               , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
1760             &gt;::type
1761         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
1762       , …
1763       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
1764             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
1765                 Args
1766               , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
1767             &gt;::type
1768         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
1769     );
1770 }
1771
1772 template &lt;
1773     typename ResultType
1774   , typename Args
1775   , typename <em>argument name</em> ## <strong>0</strong> ## _type
1776   , …
1777   , typename <em>argument name</em> ## <strong>n</strong> ## _type
1778 &gt;
1779 ResultType
1780     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1781         (ResultType(*)())
1782       , Args const&amp; args
1783       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
1784       , …
1785       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>n</strong>
1786     )
1787 {
1788     return boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1789         static_cast&lt;ResultType(*)()&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
1790       , (args, <em>keyword object of optional parameter</em> ## <strong>n + 1</strong> =
1791             <em>default value of optional parameter</em> ## <strong>n + 1</strong>
1792         )
1793       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>0</strong> ## _type&gt;(
1794             <em>argument name</em> ## <strong>0</strong>
1795         )
1796       , …
1797       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>n</strong> ## _type&gt;(
1798             <em>argument name</em> ## <strong>n</strong>
1799         )
1800       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
1801             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
1802                 Args
1803               , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
1804             &gt;::type
1805         &gt;(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
1806     );
1807 }
1808
1809 <span class="vellipsis">⋮</span>
1810
1811 template &lt;
1812     typename ResultType
1813   , typename Args
1814   , typename <em>argument name</em> ## <strong>0</strong> ## _type
1815   , …
1816   , typename <em>argument name</em> ## <strong>m</strong> ## _type
1817 &gt;
1818 ResultType
1819     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1820         (ResultType(*)())
1821       , Args const&amp; args
1822       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
1823       , …
1824       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
1825     )
1826 </pre>
1827 </div>
1828 <div class="section" id="boost-parameter-member-function-result-name-tag-namespace-arguments">
1829 <span id="boost-parameter-member-function"></span><h2><a class="toc-backref" href="#id58">7.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, arguments)</tt></a></h2>
1830 <table class="docutils field-list" frame="void" rules="none">
1831 <col class="field-name" />
1832 <col class="field-body" />
1833 <tbody valign="top">
1834 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
1835 </tr>
1836 </tbody>
1837 </table>
1838 <p>Generates a member function that can take in positional arguments, composed
1839 arguments, named arguments, and deduced arguments.</p>
1840 <table class="docutils field-list" frame="void" rules="none">
1841 <col class="field-name" />
1842 <col class="field-body" />
1843 <tbody valign="top">
1844 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1845 </tr>
1846 </tbody>
1847 </table>
1848 <p>The return type of each of the following function templates falls under a
1849 different value category.</p>
1850 <pre class="literal-block">
1851 template &lt;std::size_t N&gt;
1852 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
1853 {
1854     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1855 }
1856
1857 template &lt;std::size_t N&gt;
1858 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
1859 {
1860     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1861 }
1862
1863 template &lt;std::size_t N&gt;
1864 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
1865 {
1866     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1867     return lset;
1868 }
1869
1870 template &lt;std::size_t N&gt;
1871 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
1872 {
1873     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
1874     return clset;
1875 }
1876 </pre>
1877 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
1878 to return the correct value category when passed in an object returned by one
1879 of the functions defined above.  Assume that
1880 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
1881 <pre class="literal-block">
1882 enum invoked
1883 {
1884     passed_by_lvalue_reference_to_const
1885   , passed_by_lvalue_reference
1886   , passed_by_rvalue_reference_to_const
1887   , passed_by_rvalue_reference
1888 };
1889
1890 struct U
1891 {
1892     template &lt;std::size_t N&gt;
1893     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
1894     {
1895         return passed_by_lvalue_reference_to_const;
1896     }
1897
1898     template &lt;std::size_t N&gt;
1899     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
1900     {
1901         return passed_by_lvalue_reference;
1902     }
1903
1904     template &lt;std::size_t N&gt;
1905     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
1906     {
1907         return passed_by_rvalue_reference_to_const;
1908     }
1909
1910     template &lt;std::size_t N&gt;
1911     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
1912     {
1913         return passed_by_rvalue_reference;
1914     }
1915 };
1916 </pre>
1917 <p>Define the named parameters that will comprise the argument specification that
1918 this macro will use.  Ensure that all their tag types are in the same
1919 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
1920 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
1921 same argument to which the corresponding named parameter (without underscores)
1922 is bound, as will be shown later.</p>
1923 <pre class="literal-block">
1924 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
1925 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
1926 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
1927 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
1928 </pre>
1929 <p>Use the macro as a substitute for a normal <tt class="docutils literal">static</tt> member function
1930 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
1931 also enclose the expected value type in parentheses.  Since the value types
1932 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
1933 clause.  Otherwise, just as with a normal function, the order in which you
1934 specify the parameters determines their position.  Also, just as with a normal
1935 function, optional parameters have default values, whereas required parameters
1936 do not.  Within the function body, either simply use the parameter name or
1937 pass the matching identifier with the leading underscore to the bracket
1938 operator of <tt class="docutils literal">args</tt> to extract the corresponding argument.  Note that the
1939 second method doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to preserve value categories.</p>
1940 <pre class="literal-block">
1941 struct B
1942 {
1943     BOOST_PARAMETER_MEMBER_FUNCTION((bool), static evaluate, kw,
1944         (deduced
1945             (required
1946                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
1947                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
1948             )
1949             (optional
1950                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;), rvalue_const_bitset&lt;2&gt;())
1951                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;), rvalue_bitset&lt;3&gt;())
1952             )
1953         )
1954     )
1955     {
1956         BOOST_TEST_EQ(
1957             passed_by_lvalue_reference_to_const
1958           , U::evaluate_category&lt;0&gt;(lrc)
1959         );
1960         BOOST_TEST_EQ(
1961             passed_by_lvalue_reference
1962           , U::evaluate_category&lt;1&gt;(lr)
1963         );
1964         BOOST_TEST_EQ(
1965             passed_by_rvalue_reference_to_const
1966           , U::evaluate_category&lt;2&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;rrc0_type&gt;(rrc0))
1967         );
1968         BOOST_TEST_EQ(
1969             passed_by_rvalue_reference
1970           , U::evaluate_category&lt;3&gt;(args[_rr0])
1971         );
1972
1973         return true;
1974     }
1975 };
1976 </pre>
1977 <p>The following function calls are legal.</p>
1978 <pre class="literal-block">
1979 B::evaluate(  // positional arguments
1980     lvalue_const_bitset&lt;0&gt;()
1981   , lvalue_bitset&lt;1&gt;()
1982   , rvalue_const_bitset&lt;2&gt;()
1983   , rvalue_bitset&lt;3&gt;()
1984 );
1985 B::evaluate(  // positional arguments
1986     lvalue_const_bitset&lt;0&gt;()
1987   , lvalue_bitset&lt;1&gt;()
1988 );
1989 B::evaluate((  // composed arguments
1990     _rr0 = rvalue_bitset&lt;3&gt;()
1991   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
1992   , _lr0 = lvalue_bitset&lt;1&gt;()
1993   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
1994 ));
1995 B::evaluate(  // named arguments
1996     _rr0 = rvalue_bitset&lt;3&gt;()
1997   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
1998   , _lr0 = lvalue_bitset&lt;1&gt;()
1999   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
2000 );
2001 B::evaluate(  // named arguments
2002     _lr0 = lvalue_bitset&lt;1&gt;()
2003   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
2004 );
2005 </pre>
2006 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
2007 function calls are also legal.</p>
2008 <pre class="literal-block">
2009 B::evaluate(  // deduced arguments
2010     rvalue_bitset&lt;3&gt;()
2011   , lvalue_const_bitset&lt;0&gt;()
2012   , lvalue_bitset&lt;1&gt;()
2013   , rvalue_const_bitset&lt;2&gt;()
2014 );
2015 B::evaluate(  // deduced arguments
2016     lvalue_bitset&lt;1&gt;()
2017   , lvalue_const_bitset&lt;0&gt;()
2018 );
2019 </pre>
2020 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> and <a class="reference external" href="../../test/preprocessor_eval_category.cpp">preprocessor_eval_category.cpp</a> test programs
2021 demonstrate proper usage of this macro.</p>
2022 <p><strong>Macro parameters:</strong></p>
2023 <ul class="simple">
2024 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
2025 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
2026 generated forwarding functions.  <tt class="docutils literal">name</tt> may be qualified by the
2027 <tt class="docutils literal">static</tt> keyword to declare the member function and its helpers as not
2028 associated with any object of the enclosing type.</li>
2029 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
2030 function resides.</li>
2031 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
2032 <em>argument-specifiers</em>, as defined below.</li>
2033 </ul>
2034 <p><strong>Argument specifiers syntax:</strong></p>
2035 <pre class="literal-block">
2036 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2037
2038 specifier-group0 ::= <em>specifier-group1</em> |
2039     (
2040         '<strong>(</strong>' '<strong>deduced</strong>'
2041             <em>specifier-group1</em> {<em>specifier-group1</em>}
2042         '<strong>)</strong>'
2043     )
2044
2045 specifier-group1 ::=
2046     (
2047         '<strong>(</strong>' '<strong>optional</strong>'
2048             <em>optional-specifier</em> {<em>optional-specifier</em>}
2049         '<strong>)</strong>'
2050     ) | (
2051         '<strong>(</strong>' '<strong>required</strong>'
2052             <em>required-specifier</em> {<em>required-specifier</em>}
2053         '<strong>)</strong>'
2054     )
2055
2056 optional-specifier ::=
2057     '<strong>(</strong>'
2058         <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2059     ')'
2060
2061 required-specifier ::=
2062     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2063
2064 restriction ::=
2065     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2066     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2067     '<strong>*</strong>'
2068 </pre>
2069 <ul class="simple">
2070 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
2071 <li><tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid C++ expression; if necessary, user code can
2072 compute it in terms of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>, where <tt class="docutils literal"><span class="pre">previous-name</span></tt>
2073 is the <tt class="docutils literal"><span class="pre">argument-name</span></tt> in a previous <tt class="docutils literal"><span class="pre">specifier-group0</span></tt> or
2074 <tt class="docutils literal"><span class="pre">specifier-group1</span></tt>.  <em>This expression will be invoked exactly once.</em></li>
2075 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
2076 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
2077 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
2078 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
2079 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
2080 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
2081 Metafunction Class</a> whose first argument will be the type of the
2082 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
2083 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.  If
2084 <tt class="docutils literal">restriction</tt> uses this form, then the type of the generated name
2085 <tt class="docutils literal"><span class="pre">argument-name</span> ## _type</tt> will be computed in terms of the <strong>target
2086 type</strong>, and the generated reference <tt class="docutils literal"><span class="pre">argument-name</span></tt> (but not its
2087 corresponding entry in <tt class="docutils literal">args</tt>) will be cast to that type.</li>
2088 </ul>
2089 <p><strong>Approximate expansion:</strong></p>
2090 <p>Where:</p>
2091 <ul class="simple">
2092 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2093 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2094 </ul>
2095 <pre class="literal-block">
2096 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
2097 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
2098 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
2099 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
2100 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
2101 template &lt;typename Args&gt;
2102 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
2103
2104 // If <strong>result</strong> is a simple return type:
2105 template &lt;typename Args&gt;
2106 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
2107 {
2108     typedef <strong>result</strong> type;
2109 };
2110
2111 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
2112   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
2113         <em>list of parameter specifications, based on arguments</em>
2114     &gt;
2115 {
2116 };
2117
2118 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
2119     boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
2120
2121 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
2122 <strong>result</strong> <strong>name</strong>(
2123     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
2124   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
2125     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
2126     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
2127 )
2128 {
2129     return this-&gt;boost_param_impl ## __LINE__ ## <strong>name</strong>(
2130         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
2131             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2132           , …
2133           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
2134         )
2135     );
2136 }
2137
2138 <span class="vellipsis">⋮</span>
2139
2140 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
2141 <strong>result</strong> <strong>name</strong>(
2142     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
2143   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
2144     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
2145     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
2146 )
2147 {
2148     return this-&gt;boost_param_impl ## __LINE__ ## <strong>name</strong>(
2149         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
2150             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2151           , …
2152           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
2153         )
2154     );
2155 }
2156
2157 template &lt;typename Args&gt;
2158 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
2159     boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const&amp; args)
2160 {
2161     return this-&gt;boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2162         static_cast&lt;
2163             typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;
2164                 Args
2165             &gt;::type(*)()
2166         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2167       , args
2168       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2169             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2170                 Args
2171               , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2172             &gt;::type
2173         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2174       , …
2175       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2176             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2177                 Args
2178               , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2179             &gt;::type
2180         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2181     );
2182 }
2183
2184 template &lt;
2185     typename ResultType
2186   , typename Args
2187   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2188   , …
2189   , typename <em>argument name</em> ## <strong>n</strong> ## _type
2190 &gt;
2191 ResultType
2192     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2193         (ResultType(*)())
2194       , Args const&amp; args
2195       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2196       , …
2197       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>n</strong>
2198     )
2199 {
2200     return this-&gt;boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2201         static_cast&lt;ResultType(*)()&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2202       , (args, <em>keyword object of optional parameter</em> ## <strong>n + 1</strong> =
2203             <em>default value of optional parameter</em> ## <strong>n + 1</strong>
2204         )
2205       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>0</strong> ## _type&gt;(
2206             <em>argument name</em> ## <strong>0</strong>
2207         )
2208       , …
2209       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>n</strong> ## _type&gt;(
2210             <em>argument name</em> ## <strong>n</strong>
2211         )
2212       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2213             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2214                 Args
2215               , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2216             &gt;::type
2217         &gt;(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2218     );
2219 }
2220
2221 <span class="vellipsis">⋮</span>
2222
2223 template &lt;
2224     typename ResultType
2225   , typename Args
2226   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2227   , …
2228   , typename <em>argument name</em> ## <strong>m</strong> ## _type
2229 &gt;
2230 ResultType
2231     boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2232         (ResultType(*)())
2233       , Args const&amp; args
2234       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2235       , …
2236       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
2237     )
2238 </pre>
2239 </div>
2240 <div class="section" id="boost-parameter-const-member-function-result-name-tag-ns-arguments">
2241 <span id="boost-parameter-const-member-function"></span><h2><a class="toc-backref" href="#id59">7.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_ns, arguments)</tt></a></h2>
2242 <table class="docutils field-list" frame="void" rules="none">
2243 <col class="field-name" />
2244 <col class="field-body" />
2245 <tbody valign="top">
2246 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
2247 </tr>
2248 </tbody>
2249 </table>
2250 <p>Generates a member function that can take in positional arguments, composed
2251 arguments, named arguments, and deduced arguments.</p>
2252 <table class="docutils field-list" frame="void" rules="none">
2253 <col class="field-name" />
2254 <col class="field-body" />
2255 <tbody valign="top">
2256 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
2257 </tr>
2258 </tbody>
2259 </table>
2260 <p>The return type of each of the following function templates falls under a
2261 different value category.</p>
2262 <pre class="literal-block">
2263 template &lt;std::size_t N&gt;
2264 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
2265 {
2266     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
2267 }
2268
2269 template &lt;std::size_t N&gt;
2270 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
2271 {
2272     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
2273 }
2274
2275 template &lt;std::size_t N&gt;
2276 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
2277 {
2278     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
2279     return lset;
2280 }
2281
2282 template &lt;std::size_t N&gt;
2283 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
2284 {
2285     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
2286     return clset;
2287 }
2288 </pre>
2289 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
2290 to return the correct value category when passed in an object returned by one
2291 of the functions defined above.  Assume that
2292 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
2293 <pre class="literal-block">
2294 enum invoked
2295 {
2296     passed_by_lvalue_reference_to_const
2297   , passed_by_lvalue_reference
2298   , passed_by_rvalue_reference_to_const
2299   , passed_by_rvalue_reference
2300 };
2301
2302 struct U
2303 {
2304     template &lt;std::size_t N&gt;
2305     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
2306     {
2307         return passed_by_lvalue_reference_to_const;
2308     }
2309
2310     template &lt;std::size_t N&gt;
2311     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
2312     {
2313         return passed_by_lvalue_reference;
2314     }
2315
2316     template &lt;std::size_t N&gt;
2317     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
2318     {
2319         return passed_by_rvalue_reference_to_const;
2320     }
2321
2322     template &lt;std::size_t N&gt;
2323     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
2324     {
2325         return passed_by_rvalue_reference;
2326     }
2327 };
2328 </pre>
2329 <p>Define the named parameters that will comprise the argument specification that
2330 this macro will use.  Ensure that all their tag types are in the same
2331 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
2332 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
2333 same argument to which the corresponding named parameter (without underscores)
2334 is bound, as will be shown later.</p>
2335 <pre class="literal-block">
2336 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
2337 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
2338 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
2339 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
2340 </pre>
2341 <p>Use the macro as a substitute for a normal <tt class="docutils literal">const</tt> member function
2342 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
2343 also enclose the expected value type in parentheses.  Since the value types
2344 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
2345 clause.  Otherwise, just as with a normal function, the order in which you
2346 specify the parameters determines their position.  Also, just as with a normal
2347 function, optional parameters have default values, whereas required parameters
2348 do not.  Within the function body, either simply use the parameter name or
2349 pass the matching identifier with the leading underscore to the bracket
2350 operator of <tt class="docutils literal">args</tt> to extract the corresponding argument.  Note that the
2351 second method doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to preserve value categories.</p>
2352 <pre class="literal-block">
2353 struct B
2354 {
2355     B()
2356     {
2357     }
2358
2359     BOOST_PARAMETER_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
2360         (deduced
2361             (required
2362                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
2363                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
2364             )
2365             (optional
2366                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;), rvalue_const_bitset&lt;2&gt;())
2367                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;), rvalue_bitset&lt;3&gt;())
2368             )
2369         )
2370     )
2371     {
2372         BOOST_TEST_EQ(
2373             passed_by_lvalue_reference_to_const
2374           , U::evaluate_category&lt;0&gt;(lrc)
2375         );
2376         BOOST_TEST_EQ(
2377             passed_by_lvalue_reference
2378           , U::evaluate_category&lt;1&gt;(lr)
2379         );
2380         BOOST_TEST_EQ(
2381             passed_by_rvalue_reference_to_const
2382           , U::evaluate_category&lt;2&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;rrc0_type&gt;(rrc0))
2383         );
2384         BOOST_TEST_EQ(
2385             passed_by_rvalue_reference
2386           , U::evaluate_category&lt;3&gt;(args[_rr0])
2387         );
2388
2389         return true;
2390     }
2391 };
2392 </pre>
2393 <p>The following function calls are legal.</p>
2394 <pre class="literal-block">
2395 B const b = B();
2396 b.evaluate(  // positional arguments
2397     lvalue_const_bitset&lt;0&gt;()
2398   , lvalue_bitset&lt;1&gt;()
2399   , rvalue_const_bitset&lt;2&gt;()
2400   , rvalue_bitset&lt;3&gt;()
2401 );
2402 b.evaluate(  // positional arguments
2403     lvalue_const_bitset&lt;0&gt;()
2404   , lvalue_bitset&lt;1&gt;()
2405 );
2406 b.evaluate((  // composed arguments
2407     _rr0 = rvalue_bitset&lt;3&gt;()
2408   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
2409   , _lr0 = lvalue_bitset&lt;1&gt;()
2410   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
2411 ));
2412 b.evaluate(  // named arguments
2413     _rr0 = rvalue_bitset&lt;3&gt;()
2414   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
2415   , _lr0 = lvalue_bitset&lt;1&gt;()
2416   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
2417 );
2418 b.evaluate(  // named arguments
2419     _lr0 = lvalue_bitset&lt;1&gt;()
2420   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
2421 );
2422 </pre>
2423 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
2424 function calls are also legal.</p>
2425 <pre class="literal-block">
2426 b.evaluate(  // deduced arguments
2427     rvalue_bitset&lt;3&gt;()
2428   , lvalue_const_bitset&lt;0&gt;()
2429   , lvalue_bitset&lt;1&gt;()
2430   , rvalue_const_bitset&lt;2&gt;()
2431 );
2432 b.evaluate(  // deduced arguments
2433     lvalue_bitset&lt;1&gt;()
2434   , lvalue_const_bitset&lt;0&gt;()
2435 );
2436 </pre>
2437 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
2438 <p><strong>Macro parameters:</strong></p>
2439 <ul class="simple">
2440 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
2441 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
2442 generated forwarding functions.</li>
2443 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
2444 function resides.</li>
2445 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
2446 <em>argument-specifiers</em>, as defined below.</li>
2447 </ul>
2448 <p><strong>Argument specifiers syntax:</strong></p>
2449 <pre class="literal-block">
2450 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2451
2452 specifier-group0 ::= <em>specifier-group1</em> |
2453     (
2454         '<strong>(</strong>' '<strong>deduced</strong>'
2455             <em>specifier-group1</em> {<em>specifier-group1</em>}
2456         '<strong>)</strong>'
2457     )
2458
2459 specifier-group1 ::=
2460     (
2461         '<strong>(</strong>' '<strong>optional</strong>'
2462             <em>optional-specifier</em> {<em>optional-specifier</em>}
2463         '<strong>)</strong>'
2464     ) | (
2465         '<strong>(</strong>' '<strong>required</strong>'
2466             <em>required-specifier</em> {<em>required-specifier</em>}
2467         '<strong>)</strong>'
2468     )
2469
2470 optional-specifier ::=
2471     '<strong>(</strong>'
2472         <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2473     ')'
2474
2475 required-specifier ::=
2476     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2477
2478 restriction ::=
2479     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2480     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2481     '<strong>*</strong>'
2482 </pre>
2483 <ul class="simple">
2484 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
2485 <li><tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid C++ expression; if necessary, user code can
2486 compute it in terms of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>, where <tt class="docutils literal"><span class="pre">previous-name</span></tt>
2487 is the <tt class="docutils literal"><span class="pre">argument-name</span></tt> in a previous <tt class="docutils literal"><span class="pre">specifier-group0</span></tt> or
2488 <tt class="docutils literal"><span class="pre">specifier-group1</span></tt>.  <em>This expression will be invoked exactly once.</em></li>
2489 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
2490 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
2491 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
2492 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
2493 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
2494 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
2495 Metafunction Class</a> whose first argument will be the type of the
2496 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
2497 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.  If
2498 <tt class="docutils literal">restriction</tt> uses this form, then the type of the generated name
2499 <tt class="docutils literal"><span class="pre">argument-name</span> ## _type</tt> will be computed in terms of the <strong>target
2500 type</strong>, and the generated reference <tt class="docutils literal"><span class="pre">argument-name</span></tt> (but not its
2501 corresponding entry in <tt class="docutils literal">args</tt>) will be cast to that type.</li>
2502 </ul>
2503 <p><strong>Approximate expansion:</strong></p>
2504 <p>Where:</p>
2505 <ul class="simple">
2506 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2507 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2508 </ul>
2509 <pre class="literal-block">
2510 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
2511 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
2512 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
2513 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
2514 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
2515 template &lt;typename Args&gt;
2516 using boost_param_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
2517
2518 // If <strong>result</strong> is a simple return type:
2519 template &lt;typename Args&gt;
2520 struct boost_param_result_const_ ## __LINE__ ## <strong>name</strong>
2521 {
2522     typedef <strong>result</strong> type;
2523 };
2524
2525 struct boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
2526   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
2527         <em>list of parameter specifications, based on arguments</em>
2528     &gt;
2529 {
2530 };
2531
2532 typedef boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
2533     boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>;
2534
2535 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
2536 <strong>result</strong> <strong>name</strong>(
2537     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
2538   , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
2539     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
2540     = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
2541 ) const
2542 {
2543     return this-&gt;boost_param_impl_const ## __LINE__ ## <strong>name</strong>(
2544         boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>(
2545             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2546           , …
2547           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
2548         )
2549     );
2550 }
2551
2552 <span class="vellipsis">⋮</span>
2553
2554 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
2555 <strong>result</strong> <strong>name</strong>(
2556     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
2557   , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
2558     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
2559     = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
2560 ) const
2561 {
2562     return this-&gt;boost_param_impl_const ## __LINE__ ## <strong>name</strong>(
2563         boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()(
2564             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2565           , …
2566           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
2567         )
2568     );
2569 }
2570
2571 template &lt;typename Args&gt;
2572 typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
2573     boost_param_impl_const ## __LINE__ ## <strong>name</strong>(Args const&amp; args) const
2574 {
2575     return this-&gt;
2576     boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2577         static_cast&lt;
2578             typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong>&lt;
2579                 Args
2580             &gt;::type(*)()
2581         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2582       , args
2583       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2584             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2585                 Args
2586               , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2587             &gt;::type
2588         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2589       , …
2590       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2591             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2592                 Args
2593               , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2594             &gt;::type
2595         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2596     );
2597 }
2598
2599 template &lt;
2600     typename ResultType
2601   , typename Args
2602   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2603   , …
2604   , typename <em>argument name</em> ## <strong>n</strong> ## _type
2605 &gt;
2606 ResultType
2607     boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2608         (ResultType(*)())
2609       , Args const&amp; args
2610       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2611       , …
2612       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>n</strong>
2613     ) const
2614 {
2615     return this-&gt;
2616     boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2617         static_cast&lt;ResultType(*)()&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2618       , (args, <em>keyword object of optional parameter</em> ## <strong>n + 1</strong> =
2619             <em>default value of optional parameter</em> ## <strong>n + 1</strong>
2620         )
2621       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>0</strong> ## _type&gt;(
2622             <em>argument name</em> ## <strong>0</strong>
2623         )
2624       , …
2625       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>n</strong> ## _type&gt;(
2626             <em>argument name</em> ## <strong>n</strong>
2627         )
2628       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2629             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2630                 Args
2631               , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2632             &gt;::type
2633         &gt;(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2634     );
2635 }
2636
2637 <span class="vellipsis">⋮</span>
2638
2639 template &lt;
2640     typename ResultType
2641   , typename Args
2642   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2643   , …
2644   , typename <em>argument name</em> ## <strong>m</strong> ## _type
2645 &gt;
2646 ResultType
2647     boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2648         (ResultType(*)())
2649       , Args const&amp; args
2650       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2651       , …
2652       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
2653     ) const
2654 </pre>
2655 </div>
2656 <div class="section" id="boost-parameter-function-call-operator-result-tag-namespace-arguments">
2657 <span id="boost-parameter-function-call-operator"></span><h2><a class="toc-backref" href="#id60">7.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_namespace, arguments)</tt></a></h2>
2658 <table class="docutils field-list" frame="void" rules="none">
2659 <col class="field-name" />
2660 <col class="field-body" />
2661 <tbody valign="top">
2662 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
2663 </tr>
2664 </tbody>
2665 </table>
2666 <p>Generates a function call operator that can take in positional arguments,
2667 composed arguments, named arguments, and deduced arguments.</p>
2668 <table class="docutils field-list" frame="void" rules="none">
2669 <col class="field-name" />
2670 <col class="field-body" />
2671 <tbody valign="top">
2672 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
2673 </tr>
2674 </tbody>
2675 </table>
2676 <p>Define the named parameters that will comprise the argument specification that
2677 this macro will use.  Ensure that all their tag types are in the same
2678 namespace, which is <tt class="docutils literal">tag</tt> by default.</p>
2679 <pre class="literal-block">
2680 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(y)
2681 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(z)
2682 </pre>
2683 <p>Use the macro as a substitute for a normal function call operator
2684 header.  Enclose the return type in parentheses.  For each parameter, also
2685 enclose the expected value type in parentheses.  Since the value types are
2686 mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
2687 clause.  This is especially useful when implementing multiple
2688 Boost.Parameter-enabled function call operator overloads.</p>
2689 <pre class="literal-block">
2690 class char_reader
2691 {
2692     int index;
2693     char const* key;
2694
2695  public:
2696     explicit char_reader(char const* k) : index(0), key(k)
2697     {
2698     }
2699
2700     BOOST_PARAMETER_FUNCTION_CALL_OPERATOR((void), tag,
2701         (deduced
2702             (required
2703                 (y, (int))
2704                 (z, (char const*))
2705             )
2706         )
2707     )
2708     {
2709         this-&gt;index = y;
2710         this-&gt;key = z;
2711     }
2712
2713     <a class="reference internal" href="#boost-parameter-const-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR</tt></a>((char), tag,
2714         (deduced
2715             (required
2716                 (y, (bool))
2717                 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt;))
2718             )
2719         )
2720     )
2721     {
2722         return y ? (
2723             (z.find(this-&gt;key)-&gt;second)[this-&gt;index]
2724         ) : this-&gt;key[this-&gt;index];
2725     }
2726 };
2727 </pre>
2728 <p>As with regular argument-dependent lookup, the value types of the arguments
2729 passed in determine which function call operator overload gets invoked.</p>
2730 <pre class="literal-block">
2731 char const* keys[] = {&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;};
2732 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt; k2s;
2733 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;qux&quot;);
2734 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;wmb&quot;);
2735 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;zxc&quot;);
2736 char_reader r(keys[0]);
2737
2738 // positional arguments
2739 BOOST_TEST_EQ('q', (r(true, k2s)));
2740 BOOST_TEST_EQ('f', (r(false, k2s)));
2741
2742 // named arguments
2743 r(_z = keys[1], _y = 1);
2744 BOOST_TEST_EQ('m', (r(_z = k2s, _y = true)));
2745 BOOST_TEST_EQ('a', (r(_z = k2s, _y = false)));
2746
2747 // deduced arguments
2748 r(keys[2], 2);
2749 BOOST_TEST_EQ('c', (r(k2s, true)));
2750 BOOST_TEST_EQ('z', (r(k2s, false)));
2751 </pre>
2752 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> and <a class="reference external" href="../../test/preprocessor_deduced.cpp">preprocessor_deduced.cpp</a> test programs
2753 demonstrate proper usage of this macro.</p>
2754 <p><strong>Macro parameters:</strong></p>
2755 <ul class="simple">
2756 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
2757 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
2758 function call operator resides.</li>
2759 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
2760 <em>argument-specifiers</em>, as defined below.</li>
2761 </ul>
2762 <p><strong>Argument specifiers syntax:</strong></p>
2763 <pre class="literal-block">
2764 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2765
2766 specifier-group0 ::= <em>specifier-group1</em> |
2767     (
2768         '<strong>(</strong>' '<strong>deduced</strong>'
2769             <em>specifier-group1</em> {<em>specifier-group1</em>}
2770         '<strong>)</strong>'
2771     )
2772
2773 specifier-group1 ::=
2774     (
2775         '<strong>(</strong>' '<strong>optional</strong>'
2776             <em>optional-specifier</em> {<em>optional-specifier</em>}
2777         '<strong>)</strong>'
2778     ) | (
2779         '<strong>(</strong>' '<strong>required</strong>'
2780             <em>required-specifier</em> {<em>required-specifier</em>}
2781         '<strong>)</strong>'
2782     )
2783
2784 optional-specifier ::=
2785     '<strong>(</strong>'
2786         <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2787     ')'
2788
2789 required-specifier ::=
2790     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2791
2792 restriction ::=
2793     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2794     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2795     '<strong>*</strong>'
2796 </pre>
2797 <ul class="simple">
2798 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
2799 <li><tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid C++ expression; if necessary, user code can
2800 compute it in terms of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>, where <tt class="docutils literal"><span class="pre">previous-name</span></tt>
2801 is the <tt class="docutils literal"><span class="pre">argument-name</span></tt> in a previous <tt class="docutils literal"><span class="pre">specifier-group0</span></tt> or
2802 <tt class="docutils literal"><span class="pre">specifier-group1</span></tt>.  <em>This expression will be invoked exactly once.</em></li>
2803 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
2804 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
2805 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
2806 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
2807 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
2808 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
2809 Metafunction Class</a> whose first argument will be the type of the
2810 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
2811 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.  If
2812 <tt class="docutils literal">restriction</tt> uses this form, then the type of the generated name
2813 <tt class="docutils literal"><span class="pre">argument-name</span> ## _type</tt> will be computed in terms of the <strong>target
2814 type</strong>, and the generated reference <tt class="docutils literal"><span class="pre">argument-name</span></tt> (but not its
2815 corresponding entry in <tt class="docutils literal">args</tt>) will be cast to that type.</li>
2816 </ul>
2817 <p><strong>Approximate expansion:</strong></p>
2818 <p>Where:</p>
2819 <ul class="simple">
2820 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2821 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
2822 </ul>
2823 <pre class="literal-block">
2824 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
2825 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
2826 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
2827 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
2828 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
2829 template &lt;typename Args&gt;
2830 using boost_param_result_ ## __LINE__ ## operator = <strong>result</strong>;
2831
2832 // If <strong>result</strong> is a simple return type:
2833 template &lt;typename Args&gt;
2834 struct boost_param_result_ ## __LINE__ ## operator
2835 {
2836     typedef <strong>result</strong> type;
2837 };
2838
2839 struct boost_param_params_ ## __LINE__ ## operator
2840   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
2841         <em>list of parameter specifications, based on arguments</em>
2842     &gt;
2843 {
2844 };
2845
2846 typedef boost_param_params_ ## __LINE__ ## operator
2847     boost_param_parameters_ ## __LINE__ ## operator;
2848
2849 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
2850 <strong>result</strong> operator()(
2851     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
2852   , typename boost_param_parameters_ ## __LINE__ ## operator::match&lt;
2853         A0, …, A ## <strong>n</strong>
2854     &gt;::type = boost_param_parameters_ ## __LINE__ ## operator()
2855 )
2856 {
2857     return this-&gt;boost_param_impl ## __LINE__ ## operator(
2858         boost_param_parameters_ ## __LINE__ ## operator()(
2859             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2860           , …
2861           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
2862         )
2863     );
2864 }
2865
2866 <span class="vellipsis">⋮</span>
2867
2868 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
2869 <strong>result</strong> operator()(
2870     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
2871   , typename boost_param_parameters_ ## __LINE__ ## operator::match&lt;
2872         A0, …, A ## <strong>m</strong>
2873     &gt;::type = boost_param_parameters_ ## __LINE__ ## operator()
2874 )
2875 {
2876     return this-&gt;boost_param_impl ## __LINE__ ## operator(
2877         boost_param_parameters_ ## __LINE__ ## operator()(
2878             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
2879           , …
2880           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
2881         )
2882     );
2883 }
2884
2885 template &lt;typename Args&gt;
2886 typename boost_param_result_ ## __LINE__ ## operator&lt;Args&gt;::type
2887     boost_param_impl ## __LINE__ ## operator(Args const&amp; args)
2888 {
2889     return this-&gt;boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2890         static_cast&lt;
2891             typename boost_param_result_ ## __LINE__ ## operator&lt;
2892                 Args
2893             &gt;::type(*)()
2894         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2895       , args
2896       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2897             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2898                 Args
2899               , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2900             &gt;::type
2901         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2902       , …
2903       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2904             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2905                 Args
2906               , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2907             &gt;::type
2908         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2909     );
2910 }
2911
2912 template &lt;
2913     typename ResultType
2914   , typename Args
2915   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2916   , …
2917   , typename <em>argument name</em> ## <strong>n</strong> ## _type
2918 &gt;
2919 ResultType
2920     boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2921         (ResultType(*)())
2922       , Args const&amp; args
2923       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2924       , …
2925       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>n</strong>
2926     )
2927 {
2928     return this-&gt;boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2929         static_cast&lt;ResultType(*)()&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2930       , (args, <em>keyword object of optional parameter</em> ## <strong>n + 1</strong> =
2931             <em>default value of optional parameter</em> ## <strong>n + 1</strong>
2932         )
2933       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>0</strong> ## _type&gt;(
2934             <em>argument name</em> ## <strong>0</strong>
2935         )
2936       , …
2937       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>n</strong> ## _type&gt;(
2938             <em>argument name</em> ## <strong>n</strong>
2939         )
2940       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
2941             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
2942                 Args
2943               , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2944             &gt;::type
2945         &gt;(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2946     );
2947 }
2948
2949 <span class="vellipsis">⋮</span>
2950
2951 template &lt;
2952     typename ResultType
2953   , typename Args
2954   , typename <em>argument name</em> ## <strong>0</strong> ## _type
2955   , …
2956   , typename <em>argument name</em> ## <strong>m</strong> ## _type
2957 &gt;
2958 ResultType
2959     boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2960         (ResultType(*)())
2961       , Args const&amp; args
2962       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
2963       , …
2964       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
2965     )
2966 </pre>
2967 </div>
2968 <div class="section" id="boost-parameter-const-function-call-operator-result-tag-ns-arguments">
2969 <span id="boost-parameter-const-function-call-operator"></span><h2><a class="toc-backref" href="#id61">7.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)</tt></a></h2>
2970 <table class="docutils field-list" frame="void" rules="none">
2971 <col class="field-name" />
2972 <col class="field-body" />
2973 <tbody valign="top">
2974 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
2975 </tr>
2976 </tbody>
2977 </table>
2978 <p>Generates a function call operator that can take in positional arguments,
2979 composed arguments, named arguments, and deduced arguments.</p>
2980 <table class="docutils field-list" frame="void" rules="none">
2981 <col class="field-name" />
2982 <col class="field-body" />
2983 <tbody valign="top">
2984 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
2985 </tr>
2986 </tbody>
2987 </table>
2988 <p>The return type of each of the following function templates falls under a
2989 different value category.</p>
2990 <pre class="literal-block">
2991 template &lt;std::size_t N&gt;
2992 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
2993 {
2994     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
2995 }
2996
2997 template &lt;std::size_t N&gt;
2998 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
2999 {
3000     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3001 }
3002
3003 template &lt;std::size_t N&gt;
3004 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
3005 {
3006     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3007     return lset;
3008 }
3009
3010 template &lt;std::size_t N&gt;
3011 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
3012 {
3013     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3014     return clset;
3015 }
3016 </pre>
3017 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
3018 to return the correct value category when passed in an object returned by one
3019 of the functions defined above.  Assume that
3020 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
3021 <pre class="literal-block">
3022 enum invoked
3023 {
3024     passed_by_lvalue_reference_to_const
3025   , passed_by_lvalue_reference
3026   , passed_by_rvalue_reference_to_const
3027   , passed_by_rvalue_reference
3028 };
3029
3030 struct U
3031 {
3032     template &lt;std::size_t N&gt;
3033     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
3034     {
3035         return passed_by_lvalue_reference_to_const;
3036     }
3037
3038     template &lt;std::size_t N&gt;
3039     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
3040     {
3041         return passed_by_lvalue_reference;
3042     }
3043
3044     template &lt;std::size_t N&gt;
3045     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
3046     {
3047         return passed_by_rvalue_reference_to_const;
3048     }
3049
3050     template &lt;std::size_t N&gt;
3051     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
3052     {
3053         return passed_by_rvalue_reference;
3054     }
3055 };
3056 </pre>
3057 <p>Define the named parameters that will comprise the argument specification that
3058 this macro will use.  Ensure that all their tag types are in the same
3059 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
3060 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
3061 same argument to which the corresponding named parameter (without underscores)
3062 is bound, as will be shown later.</p>
3063 <pre class="literal-block">
3064 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
3065 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
3066 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
3067 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
3068 </pre>
3069 <p>Use the macro as a substitute for a normal <tt class="docutils literal">const</tt> function call operator
3070 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
3071 also enclose the expected value type in parentheses.  Since the value types
3072 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
3073 clause.  Otherwise, just as with a normal function, the order in which you
3074 specify the parameters determines their position.  Also, just as with a normal
3075 function, optional parameters have default values, whereas required parameters
3076 do not.  Within the function body, either simply use the parameter name or
3077 pass the matching identifier with the leading underscore to the bracket
3078 operator of <tt class="docutils literal">args</tt> to extract the corresponding argument.  Note that the
3079 second method doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to preserve value categories.</p>
3080 <pre class="literal-block">
3081 struct B
3082 {
3083     B()
3084     {
3085     }
3086
3087     BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
3088         (deduced
3089             (required
3090                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
3091                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
3092             )
3093             (optional
3094                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;), rvalue_const_bitset&lt;2&gt;())
3095                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;), rvalue_bitset&lt;3&gt;())
3096             )
3097         )
3098     )
3099     {
3100         BOOST_TEST_EQ(
3101             passed_by_lvalue_reference_to_const
3102           , U::evaluate_category&lt;0&gt;(lrc)
3103         );
3104         BOOST_TEST_EQ(
3105             passed_by_lvalue_reference
3106           , U::evaluate_category&lt;1&gt;(lr)
3107         );
3108         BOOST_TEST_EQ(
3109             passed_by_rvalue_reference_to_const
3110           , U::evaluate_category&lt;2&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;rrc0_type&gt;(rrc0))
3111         );
3112         BOOST_TEST_EQ(
3113             passed_by_rvalue_reference
3114           , U::evaluate_category&lt;3&gt;(args[_rr0])
3115         );
3116
3117         return true;
3118     }
3119 };
3120 </pre>
3121 <p>The following function calls are legal.</p>
3122 <pre class="literal-block">
3123 B const b = B();
3124 b(  // positional arguments
3125     lvalue_const_bitset&lt;0&gt;()
3126   , lvalue_bitset&lt;1&gt;()
3127   , rvalue_const_bitset&lt;2&gt;()
3128   , rvalue_bitset&lt;3&gt;()
3129 );
3130 b(  // positional arguments
3131     lvalue_const_bitset&lt;0&gt;()
3132   , lvalue_bitset&lt;1&gt;()
3133 );
3134 b((  // composed arguments
3135     _rr0 = rvalue_bitset&lt;3&gt;()
3136   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3137   , _lr0 = lvalue_bitset&lt;1&gt;()
3138   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
3139 ));
3140 b(  // named arguments
3141     _rr0 = rvalue_bitset&lt;3&gt;()
3142   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3143   , _lr0 = lvalue_bitset&lt;1&gt;()
3144   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
3145 );
3146 b(  // named arguments
3147     _lr0 = lvalue_bitset&lt;1&gt;()
3148   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3149 );
3150 </pre>
3151 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
3152 function calls are also legal.</p>
3153 <pre class="literal-block">
3154 b(  // deduced arguments
3155     rvalue_bitset&lt;3&gt;()
3156   , lvalue_const_bitset&lt;0&gt;()
3157   , lvalue_bitset&lt;1&gt;()
3158   , rvalue_const_bitset&lt;2&gt;()
3159 );
3160 b(  // deduced arguments
3161     lvalue_bitset&lt;1&gt;()
3162   , lvalue_const_bitset&lt;0&gt;()
3163 );
3164 </pre>
3165 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a>, <a class="reference external" href="../../test/preprocessor_deduced.cpp">preprocessor_deduced.cpp</a>, and
3166 <a class="reference external" href="../../test/preprocessor_eval_cat_8.cpp">preprocessor_eval_cat_8.cpp</a> test programs demonstrate proper usage of this
3167 macro.</p>
3168 <p><strong>Macro parameters:</strong></p>
3169 <ul class="simple">
3170 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
3171 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
3172 function call operator resides.</li>
3173 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
3174 <em>argument-specifiers</em>, as defined below.</li>
3175 </ul>
3176 <p><strong>Argument specifiers syntax:</strong></p>
3177 <pre class="literal-block">
3178 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3179
3180 specifier-group0 ::= <em>specifier-group1</em> |
3181     (
3182         '<strong>(</strong>' '<strong>deduced</strong>'
3183             <em>specifier-group1</em> {<em>specifier-group1</em>}
3184         '<strong>)</strong>'
3185     )
3186
3187 specifier-group1 ::=
3188     (
3189         '<strong>(</strong>' '<strong>optional</strong>'
3190             <em>optional-specifier</em> {<em>optional-specifier</em>}
3191         '<strong>)</strong>'
3192     ) | (
3193         '<strong>(</strong>' '<strong>required</strong>'
3194             <em>required-specifier</em> {<em>required-specifier</em>}
3195         '<strong>)</strong>'
3196     )
3197
3198 optional-specifier ::=
3199     '<strong>(</strong>'
3200         <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
3201     ')'
3202
3203 required-specifier ::=
3204     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3205
3206 restriction ::=
3207     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3208     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3209     '<strong>*</strong>'
3210 </pre>
3211 <ul class="simple">
3212 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
3213 <li><tt class="docutils literal"><span class="pre">default-value</span></tt> is any valid C++ expression; if necessary, user code can
3214 compute it in terms of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>, where <tt class="docutils literal"><span class="pre">previous-name</span></tt>
3215 is the <tt class="docutils literal"><span class="pre">argument-name</span></tt> in a previous <tt class="docutils literal"><span class="pre">specifier-group0</span></tt> or
3216 <tt class="docutils literal"><span class="pre">specifier-group1</span></tt>.  <em>This expression will be invoked exactly once.</em></li>
3217 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
3218 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
3219 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
3220 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
3221 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
3222 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
3223 Metafunction Class</a> whose first argument will be the type of the
3224 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
3225 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.  If
3226 <tt class="docutils literal">restriction</tt> uses this form, then the type of the generated name
3227 <tt class="docutils literal"><span class="pre">argument-name</span> ## _type</tt> will be computed in terms of the <strong>target
3228 type</strong>, and the generated reference <tt class="docutils literal"><span class="pre">argument-name</span></tt> (but not its
3229 corresponding entry in <tt class="docutils literal">args</tt>) will be cast to that type.</li>
3230 </ul>
3231 <p><strong>Approximate expansion:</strong></p>
3232 <p>Where:</p>
3233 <ul class="simple">
3234 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3235 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3236 </ul>
3237 <pre class="literal-block">
3238 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
3239 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
3240 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
3241 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
3242 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
3243 template &lt;typename Args&gt;
3244 using boost_param_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
3245
3246 // If <strong>result</strong> is a simple return type:
3247 template &lt;typename Args&gt;
3248 struct boost_param_result_const_ ## __LINE__ ## operator
3249 {
3250     typedef <strong>result</strong> type;
3251 };
3252
3253 struct boost_param_params_const_ ## __LINE__ ## operator
3254   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
3255         <em>list of parameter specifications, based on arguments</em>
3256     &gt;
3257 {
3258 };
3259
3260 typedef boost_param_params_const_ ## __LINE__ ## operator
3261     boost_param_parameters_const_ ## __LINE__ ## operator;
3262
3263 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
3264 <strong>result</strong> operator()(
3265     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
3266   , typename boost_param_parameters_const_ ## __LINE__ ## operator
3267     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
3268     = boost_param_parameters_const_ ## __LINE__ ## operator()
3269 ) const
3270 {
3271     return this-&gt;boost_param_impl_const ## __LINE__ ## operator(
3272         boost_param_parameters_const_ ## __LINE__ ## operator()(
3273             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3274           , …
3275           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
3276         )
3277     );
3278 }
3279
3280 <span class="vellipsis">⋮</span>
3281
3282 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
3283 <strong>result</strong> operator()(
3284     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
3285   , typename boost_param_parameters_const_ ## __LINE__ ## operator
3286     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
3287     = boost_param_parameters_const_ ## __LINE__ ## operator()
3288 ) const
3289 {
3290     return this-&gt;boost_param_impl_const ## __LINE__ ## operator(
3291         boost_param_parameters_const_ ## __LINE__ ## operator()(
3292             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3293           , …
3294           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
3295         )
3296     );
3297 }
3298
3299 template &lt;typename Args&gt;
3300 typename boost_param_result_const_ ## __LINE__ ## operator&lt;Args&gt;::type
3301     boost_param_impl_const ## __LINE__ ## operator(Args const&amp; args) const
3302 {
3303     return this-&gt;
3304     boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3305         static_cast&lt;
3306             typename boost_param_result_const_ ## __LINE__ ## operator&lt;
3307                 Args
3308             &gt;::type(*)()
3309         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
3310       , args
3311       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
3312             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
3313                 Args
3314               , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
3315             &gt;::type
3316         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
3317       , …
3318       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
3319             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
3320                 Args
3321               , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
3322             &gt;::type
3323         &gt;(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
3324     );
3325 }
3326
3327 template &lt;
3328     typename ResultType
3329   , typename Args
3330   , typename <em>argument name</em> ## <strong>0</strong> ## _type
3331   , …
3332   , typename <em>argument name</em> ## <strong>n</strong> ## _type
3333 &gt;
3334 ResultType
3335     boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3336         (ResultType(*)())
3337       , Args const&amp; args
3338       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
3339       , …
3340       , <em>argument name</em> ## <strong>n</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>n</strong>
3341     ) const
3342 {
3343     return this-&gt;
3344     boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3345         static_cast&lt;ResultType(*)()&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
3346       , (args, <em>keyword object of optional parameter</em> ## <strong>n + 1</strong> =
3347             <em>default value of optional parameter</em> ## <strong>n + 1</strong>
3348         )
3349       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>0</strong> ## _type&gt;(
3350             <em>argument name</em> ## <strong>0</strong>
3351         )
3352       , …
3353       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;<em>argument name</em> ## <strong>n</strong> ## _type&gt;(
3354             <em>argument name</em> ## <strong>n</strong>
3355         )
3356       , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;
3357             typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;
3358                 Args
3359               , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
3360             &gt;::type
3361         &gt;(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
3362     );
3363 }
3364
3365 <span class="vellipsis">⋮</span>
3366
3367 template &lt;
3368     typename ResultType
3369   , typename Args
3370   , typename <em>argument name</em> ## <strong>0</strong> ## _type
3371   , …
3372   , typename <em>argument name</em> ## <strong>m</strong> ## _type
3373 &gt;
3374 ResultType
3375     boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3376         (ResultType(*)())
3377       , Args const&amp; args
3378       , <em>argument name</em> ## <strong>0</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>0</strong>
3379       , …
3380       , <em>argument name</em> ## <strong>m</strong> ## _type&amp;&amp; <em>argument name</em> ## <strong>m</strong>
3381     ) const
3382 </pre>
3383 </div>
3384 <div class="section" id="boost-parameter-constructor-cls-impl-tag-namespace-arguments">
3385 <span id="boost-parameter-constructor"></span><h2><a class="toc-backref" href="#id62">7.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)</tt></a></h2>
3386 <table class="docutils field-list" frame="void" rules="none">
3387 <col class="field-name" />
3388 <col class="field-body" />
3389 <tbody valign="top">
3390 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
3391 </tr>
3392 </tbody>
3393 </table>
3394 <p>Generates a constructor that can take in positional arguments, composed
3395 arguments, named arguments, and deduced arguments.</p>
3396 <table class="docutils field-list" frame="void" rules="none">
3397 <col class="field-name" />
3398 <col class="field-body" />
3399 <tbody valign="top">
3400 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
3401 </tr>
3402 </tbody>
3403 </table>
3404 <p>Define the named parameters that will comprise the argument specification that
3405 this macro will use.  Ensure that all their tag types are in the same
3406 namespace, which is <tt class="docutils literal">tag</tt> by default.</p>
3407 <pre class="literal-block">
3408 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(y)
3409 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(z)
3410 </pre>
3411 <p>In the base class, implement a delegate constructor template that takes in an
3412 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.  You must pass the identifiers with leading underscores to
3413 <tt class="docutils literal">args</tt> in order to extract the corresponding arguments.</p>
3414 <pre class="literal-block">
3415 class char_read_base
3416 {
3417     int index;
3418     char const* key;
3419
3420  public:
3421     template &lt;typename Args&gt;
3422     explicit char_read_base(Args const&amp; args)
3423       : index(args[_y]), key(args[_z])
3424     {
3425     }
3426
3427     <a class="reference internal" href="#boost-parameter-const-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR</tt></a>((char), tag,
3428         (deduced
3429             (required
3430                 (y, (bool))
3431                 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt;))
3432             )
3433         )
3434     )
3435     {
3436         return y ? (
3437             (z.find(this-&gt;key)-&gt;second)[this-&gt;index]
3438         ) : this-&gt;key[this-&gt;index];
3439     }
3440 };
3441 </pre>
3442 <p>Use the macro as a substitute for a normal constructor definition.  Note the
3443 lack of an explicit body.  Enclose the base type in parentheses.  For each
3444 parameter, also enclose the expected value type in parentheses.  Since the
3445 value types are mutually exclusive, you can wrap the parameters in a
3446 <tt class="docutils literal">(deduced …)</tt> clause.</p>
3447 <pre class="literal-block">
3448 struct char_reader : public char_read_base
3449 {
3450     BOOST_PARAMETER_CONSTRUCTOR(char_reader, (char_read_base), tag,
3451         (deduced
3452             (required
3453                 (y, (int))
3454                 (z, (char const*))
3455             )
3456         )
3457     )
3458 };
3459 </pre>
3460 <p>The following <tt class="docutils literal">char_reader</tt> constructor calls are legal.</p>
3461 <pre class="literal-block">
3462 char const* keys[] = {&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;};
3463 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt; k2s;
3464 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;qux&quot;);
3465 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;wmb&quot;);
3466 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;zxc&quot;);
3467
3468 // positional arguments
3469 char_reader r0(0, keys[0]);
3470 BOOST_TEST_EQ('q', (r0(true, k2s)));
3471 BOOST_TEST_EQ('f', (r0(false, k2s)));
3472
3473 // named arguments
3474 char_reader r1(_z = keys[1], _y = 1);
3475 BOOST_TEST_EQ('m', (r1(_z = k2s, _y = true)));
3476 BOOST_TEST_EQ('a', (r1(_z = k2s, _y = false)));
3477
3478 // deduced arguments
3479 char_reader r2(keys[2], 2);
3480 BOOST_TEST_EQ('c', (r2(k2s, true)));
3481 BOOST_TEST_EQ('z', (r2(k2s, false)));
3482 </pre>
3483 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> and <a class="reference external" href="../../test/preprocessor_deduced.cpp">preprocessor_deduced.cpp</a> test programs
3484 demonstrate proper usage of this macro.</p>
3485 <p><strong>Macro parameters:</strong></p>
3486 <ul class="simple">
3487 <li><tt class="docutils literal">cls</tt> is the name of the enclosing class.</li>
3488 <li><tt class="docutils literal">impl</tt> is the parenthesized implementation base class for <tt class="docutils literal">cls</tt>.</li>
3489 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
3490 constructor resides.</li>
3491 <li><tt class="docutils literal">arguments</tt> is a list of <em>argument-specifiers</em>, as defined below.</li>
3492 </ul>
3493 <p><strong>Argument specifiers syntax:</strong></p>
3494 <pre class="literal-block">
3495 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3496
3497 specifier-group0 ::= <em>specifier-group1</em> |
3498     (
3499         '<strong>(</strong>' '<strong>deduced</strong>'
3500             <em>specifier-group1</em> {<em>specifier-group1</em>}
3501         '<strong>)</strong>'
3502     )
3503
3504 specifier-group1 ::=
3505     (
3506         '<strong>(</strong>' '<strong>optional</strong>'
3507             <em>specifier</em> {<em>specifier</em>}
3508         '<strong>)</strong>'
3509     ) | (
3510         '<strong>(</strong>' '<strong>required</strong>'
3511             <em>specifier</em> {<em>specifier</em>}
3512         '<strong>)</strong>'
3513     )
3514
3515 specifier ::=
3516     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3517
3518 restriction ::=
3519     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3520     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3521     '<strong>*</strong>'
3522 </pre>
3523 <ul class="simple">
3524 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
3525 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
3526 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
3527 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
3528 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
3529 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
3530 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
3531 Metafunction Class</a> whose first argument will be the type of the
3532 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
3533 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
3534 </ul>
3535 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
3536 delegate constructor in <tt class="docutils literal">impl</tt> to determine the default value of all
3537 optional arguments.</p>
3538 <p><strong>Approximate expansion:</strong></p>
3539 <p>Where:</p>
3540 <ul class="simple">
3541 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3542 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3543 </ul>
3544 <pre class="literal-block">
3545 struct boost_param_params_ ## __LINE__ ## ctor
3546   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
3547         <em>list of parameter specifications, based on arguments</em>
3548     &gt;
3549 {
3550 };
3551
3552 typedef boost_param_params_ ## __LINE__ ## ctor
3553     constructor_parameters ## __LINE__;
3554
3555 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
3556 <strong>cls</strong>(A0&amp;&amp; a0, …, A ## <strong>n</strong> &amp;&amp; a ## <strong>n</strong>)
3557   : <strong>impl</strong>(
3558         constructor_parameters ## __LINE__(
3559             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3560           , …
3561           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
3562         )
3563     )
3564 {
3565 }
3566
3567 <span class="vellipsis">⋮</span>
3568
3569 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
3570 <strong>cls</strong>(A0&amp;&amp; a0, …, A ## <strong>m</strong> &amp;&amp; a ## <strong>m</strong>)
3571   : <strong>impl</strong>(
3572         constructor_parameters ## __LINE__(
3573             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3574           , …
3575           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
3576         )
3577     )
3578 {
3579 }
3580 </pre>
3581 </div>
3582 <div class="section" id="boost-parameter-basic-function-result-name-tag-namespace-arguments">
3583 <span id="boost-parameter-basic-function"></span><h2><a class="toc-backref" href="#id63">7.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, arguments)</tt></a></h2>
3584 <table class="docutils field-list" frame="void" rules="none">
3585 <col class="field-name" />
3586 <col class="field-body" />
3587 <tbody valign="top">
3588 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
3589 </tr>
3590 </tbody>
3591 </table>
3592 <p>Generates a function that can take in positional arguments, composed
3593 arguments, named arguments, and deduced arguments.</p>
3594 <table class="docutils field-list" frame="void" rules="none">
3595 <col class="field-name" />
3596 <col class="field-body" />
3597 <tbody valign="top">
3598 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
3599 </tr>
3600 </tbody>
3601 </table>
3602 <p>The return type of each of the following function templates falls under a
3603 different value category.</p>
3604 <pre class="literal-block">
3605 template &lt;std::size_t N&gt;
3606 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
3607 {
3608     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3609 }
3610
3611 template &lt;std::size_t N&gt;
3612 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
3613 {
3614     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3615 }
3616
3617 template &lt;std::size_t N&gt;
3618 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
3619 {
3620     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3621     return lset;
3622 }
3623
3624 template &lt;std::size_t N&gt;
3625 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
3626 {
3627     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3628     return clset;
3629 }
3630 </pre>
3631 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
3632 to return the correct value category when passed in an object returned by one
3633 of the functions defined above.  Assume that
3634 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
3635 <pre class="literal-block">
3636 enum invoked
3637 {
3638     passed_by_lvalue_reference_to_const
3639   , passed_by_lvalue_reference
3640   , passed_by_rvalue_reference_to_const
3641   , passed_by_rvalue_reference
3642 };
3643
3644 struct U
3645 {
3646     template &lt;std::size_t N&gt;
3647     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
3648     {
3649         return passed_by_lvalue_reference_to_const;
3650     }
3651
3652     template &lt;std::size_t N&gt;
3653     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
3654     {
3655         return passed_by_lvalue_reference;
3656     }
3657
3658     template &lt;std::size_t N&gt;
3659     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
3660     {
3661         return passed_by_rvalue_reference_to_const;
3662     }
3663
3664     template &lt;std::size_t N&gt;
3665     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
3666     {
3667         return passed_by_rvalue_reference;
3668     }
3669 };
3670 </pre>
3671 <p>Define the named parameters that will comprise the argument specification that
3672 this macro will use.  Ensure that all their tag types are in the same
3673 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
3674 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
3675 same argument to which the corresponding named parameter (without underscores)
3676 is bound, as will be shown later.</p>
3677 <pre class="literal-block">
3678 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
3679 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
3680 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
3681 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
3682 </pre>
3683 <p>Use the macro as a substitute for a normal function header.  Enclose the
3684 return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter, also enclose the
3685 expected value type in parentheses.  Since the value types are mutually
3686 exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
3687 clause.  Otherwise, just as with a normal function, the order in which you
3688 specify the parameters determines their position.  However, unlike a normal
3689 function, default values must be specified within the function body.  Also
3690 within the function body, you must pass the matching identifier with the
3691 leading underscore to the bracket operator of <tt class="docutils literal">args</tt> to extract the
3692 corresponding argument, but at least this doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to
3693 preserve value categories.</p>
3694 <pre class="literal-block">
3695 BOOST_PARAMETER_BASIC_FUNCTION((bool), evaluate, kw,
3696     (deduced
3697         (required
3698             (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
3699             (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
3700         )
3701         (optional
3702             (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;))
3703             (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;))
3704         )
3705     )
3706 )
3707 {
3708     BOOST_TEST_EQ(
3709         passed_by_lvalue_reference_to_const
3710       , U::evaluate_category&lt;0&gt;(args[_lrc])
3711     );
3712     BOOST_TEST_EQ(
3713         passed_by_lvalue_reference
3714       , U::evaluate_category&lt;1&gt;(args[_lr])
3715     );
3716     BOOST_TEST_EQ(
3717         passed_by_rvalue_reference_to_const
3718       , U::evaluate_category&lt;2&gt;(
3719             args[_rrc0 | rvalue_const_bitset&lt;2&gt;()]
3720         )
3721     );
3722     BOOST_TEST_EQ(
3723         passed_by_rvalue_reference
3724       , U::evaluate_category&lt;3&gt;(args[_rr0 | rvalue_bitset&lt;3&gt;()])
3725     );
3726
3727     return true;
3728 }
3729 </pre>
3730 <p>The following function calls are legal.</p>
3731 <pre class="literal-block">
3732 evaluate(  // positional arguments
3733     lvalue_const_bitset&lt;0&gt;()
3734   , lvalue_bitset&lt;1&gt;()
3735   , rvalue_const_bitset&lt;2&gt;()
3736   , rvalue_bitset&lt;3&gt;()
3737 );
3738 evaluate(  // positional arguments
3739     lvalue_const_bitset&lt;0&gt;()
3740   , lvalue_bitset&lt;1&gt;()
3741 );
3742 evaluate((  // composed arguments
3743     _rr0 = rvalue_bitset&lt;3&gt;()
3744   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3745   , _lr0 = lvalue_bitset&lt;1&gt;()
3746   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
3747 ));
3748 evaluate(  // named arguments
3749     _rr0 = rvalue_bitset&lt;3&gt;()
3750   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3751   , _lr0 = lvalue_bitset&lt;1&gt;()
3752   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
3753 );
3754 evaluate(  // named arguments
3755     _lr0 = lvalue_bitset&lt;1&gt;()
3756   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
3757 );
3758 </pre>
3759 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
3760 function calls are also legal.</p>
3761 <pre class="literal-block">
3762 evaluate(  // deduced arguments
3763     rvalue_bitset&lt;3&gt;()
3764   , lvalue_const_bitset&lt;0&gt;()
3765   , lvalue_bitset&lt;1&gt;()
3766   , rvalue_const_bitset&lt;2&gt;()
3767 );
3768 evaluate(  // deduced arguments
3769     lvalue_bitset&lt;1&gt;()
3770   , lvalue_const_bitset&lt;0&gt;()
3771 );
3772 </pre>
3773 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
3774 <p><strong>Macro parameters:</strong></p>
3775 <ul class="simple">
3776 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
3777 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
3778 generated forwarding functions.</li>
3779 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
3780 function resides.</li>
3781 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
3782 <em>argument-specifiers</em>, as defined below.</li>
3783 </ul>
3784 <p><strong>Argument specifiers syntax:</strong></p>
3785 <pre class="literal-block">
3786 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3787
3788 specifier-group0 ::= <em>specifier-group1</em> |
3789     (
3790         '<strong>(</strong>' '<strong>deduced</strong>'
3791             <em>specifier-group1</em> {<em>specifier-group1</em>}
3792         '<strong>)</strong>'
3793     )
3794
3795 specifier-group1 ::=
3796     (
3797         '<strong>(</strong>' '<strong>optional</strong>'
3798             <em>specifier</em> {<em>specifier</em>}
3799         '<strong>)</strong>'
3800     ) | (
3801         '<strong>(</strong>' '<strong>required</strong>'
3802             <em>specifier</em> {<em>specifier</em>}
3803         '<strong>)</strong>'
3804     )
3805
3806 specifier ::=
3807     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3808
3809 restriction ::=
3810     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3811     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3812     '<strong>*</strong>'
3813 </pre>
3814 <ul class="simple">
3815 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
3816 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
3817 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
3818 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
3819 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
3820 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
3821 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
3822 Metafunction Class</a> whose first argument will be the type of the
3823 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
3824 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
3825 </ul>
3826 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
3827 function body to determine the default value of all optional arguments.</p>
3828 <p><strong>Approximate expansion:</strong></p>
3829 <p>Where:</p>
3830 <ul class="simple">
3831 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3832 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
3833 </ul>
3834 <pre class="literal-block">
3835 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
3836 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
3837 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
3838 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
3839 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
3840 template &lt;typename Args&gt;
3841 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
3842
3843 // If <strong>result</strong> is a simple return type:
3844 template &lt;typename Args&gt;
3845 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
3846 {
3847     typedef <strong>result</strong> type;
3848 };
3849
3850 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
3851   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
3852         <em>list of parameter specifications, based on arguments</em>
3853     &gt;
3854 {
3855 };
3856
3857 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
3858     boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
3859
3860 template &lt;typename Args&gt;
3861 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
3862     boost_param_impl ## <strong>name</strong>(Args const&amp;);
3863
3864 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
3865 <strong>result</strong> <strong>name</strong>(
3866     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
3867   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
3868     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
3869     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
3870 )
3871 {
3872     return boost_param_impl ## __LINE__ ## <strong>name</strong>(
3873         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
3874             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3875           , …
3876           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
3877         )
3878     );
3879 }
3880
3881 <span class="vellipsis">⋮</span>
3882
3883 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
3884 <strong>result</strong> <strong>name</strong>(
3885     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
3886   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
3887     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
3888     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
3889 )
3890 {
3891     return boost_param_impl ## __LINE__ ## <strong>name</strong>(
3892         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
3893             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
3894           , …
3895           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
3896         )
3897     );
3898 }
3899
3900 template &lt;typename Args&gt;
3901 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
3902     boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const&amp; args)
3903 </pre>
3904 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
3905 available for use within the function body.</p>
3906 </div>
3907 <div class="section" id="boost-parameter-basic-member-function-result-name-tag-ns-arguments">
3908 <span id="boost-parameter-basic-member-function"></span><h2><a class="toc-backref" href="#id64">7.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_ns, arguments)</tt></a></h2>
3909 <table class="docutils field-list" frame="void" rules="none">
3910 <col class="field-name" />
3911 <col class="field-body" />
3912 <tbody valign="top">
3913 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
3914 </tr>
3915 </tbody>
3916 </table>
3917 <p>Generates a member function that can take in positional arguments, composed
3918 arguments, named arguments, and deduced arguments.</p>
3919 <table class="docutils field-list" frame="void" rules="none">
3920 <col class="field-name" />
3921 <col class="field-body" />
3922 <tbody valign="top">
3923 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
3924 </tr>
3925 </tbody>
3926 </table>
3927 <p>The return type of each of the following function templates falls under a
3928 different value category.</p>
3929 <pre class="literal-block">
3930 template &lt;std::size_t N&gt;
3931 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
3932 {
3933     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3934 }
3935
3936 template &lt;std::size_t N&gt;
3937 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
3938 {
3939     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3940 }
3941
3942 template &lt;std::size_t N&gt;
3943 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
3944 {
3945     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3946     return lset;
3947 }
3948
3949 template &lt;std::size_t N&gt;
3950 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
3951 {
3952     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
3953     return clset;
3954 }
3955 </pre>
3956 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
3957 to return the correct value category when passed in an object returned by one
3958 of the functions defined above.  Assume that
3959 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
3960 <pre class="literal-block">
3961 enum invoked
3962 {
3963     passed_by_lvalue_reference_to_const
3964   , passed_by_lvalue_reference
3965   , passed_by_rvalue_reference_to_const
3966   , passed_by_rvalue_reference
3967 };
3968
3969 struct U
3970 {
3971     template &lt;std::size_t N&gt;
3972     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
3973     {
3974         return passed_by_lvalue_reference_to_const;
3975     }
3976
3977     template &lt;std::size_t N&gt;
3978     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
3979     {
3980         return passed_by_lvalue_reference;
3981     }
3982
3983     template &lt;std::size_t N&gt;
3984     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
3985     {
3986         return passed_by_rvalue_reference_to_const;
3987     }
3988
3989     template &lt;std::size_t N&gt;
3990     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
3991     {
3992         return passed_by_rvalue_reference;
3993     }
3994 };
3995 </pre>
3996 <p>Define the named parameters that will comprise the argument specification that
3997 this macro will use.  Ensure that all their tag types are in the same
3998 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
3999 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4000 same argument to which the corresponding named parameter (without underscores)
4001 is bound, as will be shown later.</p>
4002 <pre class="literal-block">
4003 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
4004 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
4005 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
4006 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
4007 </pre>
4008 <p>Use the macro as a substitute for a normal <tt class="docutils literal">static</tt> member function
4009 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
4010 also enclose the expected value type in parentheses.  Since the value types
4011 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
4012 clause.  Otherwise, just as with a normal function, the order in which you
4013 specify the parameters determines their position.  However, unlike a normal
4014 function, default values must be specified within the function body.  Also
4015 within the function body, you must pass the matching identifier with the
4016 leading underscore to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4017 corresponding argument, but at least this doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to
4018 preserve value categories.</p>
4019 <pre class="literal-block">
4020 struct B
4021 {
4022     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((bool), static evaluate, kw,
4023         (deduced
4024             (required
4025                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
4026                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
4027             )
4028             (optional
4029                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;))
4030                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;))
4031             )
4032         )
4033     )
4034     {
4035         BOOST_TEST_EQ(
4036             passed_by_lvalue_reference_to_const
4037           , U::evaluate_category&lt;0&gt;(args[_lrc])
4038         );
4039         BOOST_TEST_EQ(
4040             passed_by_lvalue_reference
4041           , U::evaluate_category&lt;1&gt;(args[_lr])
4042         );
4043         BOOST_TEST_EQ(
4044             passed_by_rvalue_reference_to_const
4045           , U::evaluate_category&lt;2&gt;(
4046                 args[_rrc0 | rvalue_const_bitset&lt;2&gt;()]
4047             )
4048         );
4049         BOOST_TEST_EQ(
4050             passed_by_rvalue_reference
4051           , U::evaluate_category&lt;3&gt;(
4052                 args[_rr0 | rvalue_bitset&lt;3&gt;()]
4053             )
4054         );
4055
4056         return true;
4057     }
4058 };
4059 </pre>
4060 <p>The following function calls are legal.</p>
4061 <pre class="literal-block">
4062 B::evaluate(  // positional arguments
4063     lvalue_const_bitset&lt;0&gt;()
4064   , lvalue_bitset&lt;1&gt;()
4065   , rvalue_const_bitset&lt;2&gt;()
4066   , rvalue_bitset&lt;3&gt;()
4067 );
4068 B::evaluate(  // positional arguments
4069     lvalue_const_bitset&lt;0&gt;()
4070   , lvalue_bitset&lt;1&gt;()
4071 );
4072 B::evaluate((  // composed arguments
4073     _rr0 = rvalue_bitset&lt;3&gt;()
4074   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4075   , _lr0 = lvalue_bitset&lt;1&gt;()
4076   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4077 ));
4078 B::evaluate(  // named arguments
4079     _rr0 = rvalue_bitset&lt;3&gt;()
4080   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4081   , _lr0 = lvalue_bitset&lt;1&gt;()
4082   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4083 );
4084 B::evaluate(  // named arguments
4085     _lr0 = lvalue_bitset&lt;1&gt;()
4086   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4087 );
4088 </pre>
4089 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
4090 function calls are also legal.</p>
4091 <pre class="literal-block">
4092 B::evaluate(  // deduced arguments
4093     rvalue_bitset&lt;3&gt;()
4094   , lvalue_const_bitset&lt;0&gt;()
4095   , lvalue_bitset&lt;1&gt;()
4096   , rvalue_const_bitset&lt;2&gt;()
4097 );
4098 B::evaluate(  // deduced arguments
4099     lvalue_bitset&lt;1&gt;()
4100   , lvalue_const_bitset&lt;0&gt;()
4101 );
4102 </pre>
4103 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
4104 <p><strong>Macro parameters:</strong></p>
4105 <ul class="simple">
4106 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
4107 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
4108 generated forwarding functions.  <tt class="docutils literal">name</tt> may be qualified by the
4109 <tt class="docutils literal">static</tt> keyword to declare the member function and its helpers as not
4110 associated with any object of the enclosing type.</li>
4111 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
4112 function resides.</li>
4113 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
4114 <em>argument-specifiers</em>, as defined below.</li>
4115 </ul>
4116 <p><strong>Argument specifiers syntax:</strong></p>
4117 <pre class="literal-block">
4118 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4119
4120 specifier-group0 ::= <em>specifier-group1</em> |
4121     (
4122         '<strong>(</strong>' '<strong>deduced</strong>'
4123             <em>specifier-group1</em> {<em>specifier-group1</em>}
4124         '<strong>)</strong>'
4125     )
4126
4127 specifier-group1 ::=
4128     (
4129         '<strong>(</strong>' '<strong>optional</strong>'
4130             <em>specifier</em> {<em>specifier</em>}
4131         '<strong>)</strong>'
4132     ) | (
4133         '<strong>(</strong>' '<strong>required</strong>'
4134             <em>specifier</em> {<em>specifier</em>}
4135         '<strong>)</strong>'
4136     )
4137
4138 specifier ::=
4139     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4140
4141 restriction ::=
4142     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4143     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4144     '<strong>*</strong>'
4145 </pre>
4146 <ul class="simple">
4147 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
4148 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
4149 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
4150 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
4151 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
4152 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
4153 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
4154 Metafunction Class</a> whose first argument will be the type of the
4155 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
4156 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
4157 </ul>
4158 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
4159 function body to determine the default value of all optional arguments.</p>
4160 <p><strong>Approximate expansion:</strong></p>
4161 <p>Where:</p>
4162 <ul class="simple">
4163 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4164 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4165 </ul>
4166 <pre class="literal-block">
4167 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
4168 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
4169 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
4170 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
4171 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
4172 template &lt;typename Args&gt;
4173 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
4174
4175 // If <strong>result</strong> is a simple return type:
4176 template &lt;typename Args&gt;
4177 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
4178 {
4179     typedef <strong>result</strong> type;
4180 };
4181
4182 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
4183   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
4184         <em>list of parameter specifications, based on arguments</em>
4185     &gt;
4186 {
4187 };
4188
4189 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
4190     boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
4191
4192 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
4193 <strong>result</strong> <strong>name</strong>(
4194     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
4195   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
4196     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
4197     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
4198 )
4199 {
4200     return this-&gt;boost_param_impl ## <strong>name</strong>(
4201         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
4202             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4203           , …
4204           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
4205         )
4206     );
4207 }
4208
4209 <span class="vellipsis">⋮</span>
4210
4211 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
4212 <strong>result</strong> <strong>name</strong>(
4213     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
4214   , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
4215     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
4216     = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
4217 )
4218 {
4219     return this-&gt;boost_param_impl ## <strong>name</strong>(
4220         boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()(
4221             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4222           , …
4223           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
4224         )
4225     );
4226 }
4227
4228 template &lt;typename Args&gt;
4229 typename boost_param_result_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
4230     boost_param_impl ## <strong>name</strong>(Args const&amp; args)
4231 </pre>
4232 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
4233 available for use within the function body.</p>
4234 </div>
4235 <div class="section" id="boost-parameter-basic-const-member-function-result-name-tag-ns-args">
4236 <span id="boost-parameter-basic-const-member-function"></span><h2><a class="toc-backref" href="#id65">7.9&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_ns, args)</tt></a></h2>
4237 <table class="docutils field-list" frame="void" rules="none">
4238 <col class="field-name" />
4239 <col class="field-body" />
4240 <tbody valign="top">
4241 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
4242 </tr>
4243 </tbody>
4244 </table>
4245 <p>Generates a member function that can take in positional arguments, composed
4246 arguments, named arguments, and deduced arguments.</p>
4247 <table class="docutils field-list" frame="void" rules="none">
4248 <col class="field-name" />
4249 <col class="field-body" />
4250 <tbody valign="top">
4251 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
4252 </tr>
4253 </tbody>
4254 </table>
4255 <p>The return type of each of the following function templates falls under a
4256 different value category.</p>
4257 <pre class="literal-block">
4258 template &lt;std::size_t N&gt;
4259 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
4260 {
4261     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4262 }
4263
4264 template &lt;std::size_t N&gt;
4265 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
4266 {
4267     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4268 }
4269
4270 template &lt;std::size_t N&gt;
4271 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
4272 {
4273     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4274     return lset;
4275 }
4276
4277 template &lt;std::size_t N&gt;
4278 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
4279 {
4280     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4281     return clset;
4282 }
4283 </pre>
4284 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
4285 to return the correct value category when passed in an object returned by one
4286 of the functions defined above.  Assume that
4287 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
4288 <pre class="literal-block">
4289 enum invoked
4290 {
4291     passed_by_lvalue_reference_to_const
4292   , passed_by_lvalue_reference
4293   , passed_by_rvalue_reference_to_const
4294   , passed_by_rvalue_reference
4295 };
4296
4297 struct U
4298 {
4299     template &lt;std::size_t N&gt;
4300     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
4301     {
4302         return passed_by_lvalue_reference_to_const;
4303     }
4304
4305     template &lt;std::size_t N&gt;
4306     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
4307     {
4308         return passed_by_lvalue_reference;
4309     }
4310
4311     template &lt;std::size_t N&gt;
4312     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
4313     {
4314         return passed_by_rvalue_reference_to_const;
4315     }
4316
4317     template &lt;std::size_t N&gt;
4318     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
4319     {
4320         return passed_by_rvalue_reference;
4321     }
4322 };
4323 </pre>
4324 <p>Define the named parameters that will comprise the argument specification that
4325 this macro will use.  Ensure that all their tag types are in the same
4326 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
4327 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4328 same argument to which the corresponding named parameter (without underscores)
4329 is bound, as will be shown later.</p>
4330 <pre class="literal-block">
4331 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
4332 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
4333 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
4334 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
4335 </pre>
4336 <p>Use the macro as a substitute for a normal <tt class="docutils literal">const</tt> member function
4337 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
4338 also enclose the expected value type in parentheses.  Since the value types
4339 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
4340 clause.  Otherwise, just as with a normal function, the order in which you
4341 specify the parameters determines their position.  However, unlike a normal
4342 function, default values must be specified within the function body.  Also
4343 within the function body, you must pass the matching identifier with the
4344 leading underscore to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4345 corresponding argument, but at least this doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to
4346 preserve value categories.</p>
4347 <pre class="literal-block">
4348 struct B
4349 {
4350     B()
4351     {
4352     }
4353
4354     BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
4355         (deduced
4356             (required
4357                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
4358                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
4359             )
4360             (optional
4361                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;))
4362                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;))
4363             )
4364         )
4365     )
4366     {
4367         BOOST_TEST_EQ(
4368             passed_by_lvalue_reference_to_const
4369           , U::evaluate_category&lt;0&gt;(args[_lrc])
4370         );
4371         BOOST_TEST_EQ(
4372             passed_by_lvalue_reference
4373           , U::evaluate_category&lt;1&gt;(args[_lr])
4374         );
4375         BOOST_TEST_EQ(
4376             passed_by_rvalue_reference_to_const
4377           , U::evaluate_category&lt;2&gt;(
4378                 args[_rrc0 | rvalue_const_bitset&lt;2&gt;()]
4379             )
4380         );
4381         BOOST_TEST_EQ(
4382             passed_by_rvalue_reference
4383           , U::evaluate_category&lt;3&gt;(
4384                 args[_rr0 | rvalue_bitset&lt;3&gt;()]
4385             )
4386         );
4387
4388         return true;
4389     }
4390 };
4391 </pre>
4392 <p>The following function calls are legal.</p>
4393 <pre class="literal-block">
4394 B const b = B();
4395 b.evaluate(  // positional arguments
4396     lvalue_const_bitset&lt;0&gt;()
4397   , lvalue_bitset&lt;1&gt;()
4398   , rvalue_const_bitset&lt;2&gt;()
4399   , rvalue_bitset&lt;3&gt;()
4400 );
4401 b.evaluate(  // positional arguments
4402     lvalue_const_bitset&lt;0&gt;()
4403   , lvalue_bitset&lt;1&gt;()
4404 );
4405 b.evaluate((  // composed arguments
4406     _rr0 = rvalue_bitset&lt;3&gt;()
4407   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4408   , _lr0 = lvalue_bitset&lt;1&gt;()
4409   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4410 ));
4411 b.evaluate(  // named arguments
4412     _rr0 = rvalue_bitset&lt;3&gt;()
4413   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4414   , _lr0 = lvalue_bitset&lt;1&gt;()
4415   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4416 );
4417 b.evaluate(  // named arguments
4418     _lr0 = lvalue_bitset&lt;1&gt;()
4419   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4420 );
4421 </pre>
4422 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
4423 function calls are also legal.</p>
4424 <pre class="literal-block">
4425 b.evaluate(  // deduced arguments
4426     rvalue_bitset&lt;3&gt;()
4427   , lvalue_const_bitset&lt;0&gt;()
4428   , lvalue_bitset&lt;1&gt;()
4429   , rvalue_const_bitset&lt;2&gt;()
4430 );
4431 b.evaluate(  // deduced arguments
4432     lvalue_bitset&lt;1&gt;()
4433   , lvalue_const_bitset&lt;0&gt;()
4434 );
4435 </pre>
4436 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
4437 <p><strong>Macro parameters:</strong></p>
4438 <ul class="simple">
4439 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
4440 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
4441 generated forwarding functions.</li>
4442 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
4443 function resides.</li>
4444 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
4445 <em>argument-specifiers</em>, as defined below.</li>
4446 </ul>
4447 <p><strong>Argument specifiers syntax:</strong></p>
4448 <pre class="literal-block">
4449 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4450
4451 specifier-group0 ::= <em>specifier-group1</em> |
4452     (
4453         '<strong>(</strong>' '<strong>deduced</strong>'
4454             <em>specifier-group1</em> {<em>specifier-group1</em>}
4455         '<strong>)</strong>'
4456     )
4457
4458 specifier-group1 ::=
4459     (
4460         '<strong>(</strong>' '<strong>optional</strong>'
4461             <em>specifier</em> {<em>specifier</em>}
4462         '<strong>)</strong>'
4463     ) | (
4464         '<strong>(</strong>' '<strong>required</strong>'
4465             <em>specifier</em> {<em>specifier</em>}
4466         '<strong>)</strong>'
4467     )
4468
4469 specifier ::=
4470     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4471
4472 restriction ::=
4473     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4474     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4475     '<strong>*</strong>'
4476 </pre>
4477 <ul class="simple">
4478 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
4479 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
4480 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
4481 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
4482 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
4483 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
4484 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
4485 Metafunction Class</a> whose first argument will be the type of the
4486 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
4487 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
4488 </ul>
4489 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
4490 function body to determine the default value of all optional arguments.</p>
4491 <p><strong>Approximate expansion:</strong></p>
4492 <p>Where:</p>
4493 <ul class="simple">
4494 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4495 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4496 </ul>
4497 <pre class="literal-block">
4498 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
4499 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
4500 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
4501 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
4502 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
4503 template &lt;typename Args&gt;
4504 using boost_param_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
4505
4506 // If <strong>result</strong> is a simple return type:
4507 template &lt;typename Args&gt;
4508 struct boost_param_result_const_ ## __LINE__ ## <strong>name</strong>
4509 {
4510     typedef <strong>result</strong> type;
4511 };
4512
4513 struct boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
4514   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
4515         <em>list of parameter specifications, based on arguments</em>
4516     &gt;
4517 {
4518 };
4519
4520 typedef boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
4521     boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>;
4522
4523 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
4524 <strong>result</strong> <strong>name</strong>(
4525     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
4526   , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
4527     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
4528     = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
4529 ) const
4530 {
4531     return this-&gt;boost_param_impl_const ## __LINE__ ## <strong>name</strong>(
4532         boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()(
4533             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4534           , …
4535           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
4536         )
4537     );
4538 }
4539
4540 <span class="vellipsis">⋮</span>
4541
4542 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
4543 <strong>result</strong> <strong>name</strong>(
4544     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
4545   , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
4546     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
4547     = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
4548 ) const
4549 {
4550     return this-&gt;boost_param_impl_const ## __LINE__ ## <strong>name</strong>(
4551         boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()(
4552             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4553           , …
4554           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
4555         )
4556     );
4557 }
4558
4559 template &lt;typename Args&gt;
4560 typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong>&lt;Args&gt;::type
4561     boost_param_impl_const ## __LINE__ ## <strong>name</strong>(Args const&amp; args) const
4562 </pre>
4563 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
4564 available for use within the function body.</p>
4565 </div>
4566 <div class="section" id="boost-parameter-basic-function-call-operator-result-tag-ns-arguments">
4567 <span id="boost-parameter-basic-function-call-operator"></span><h2><a class="toc-backref" href="#id66">7.10&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)</tt></a></h2>
4568 <table class="docutils field-list" frame="void" rules="none">
4569 <col class="field-name" />
4570 <col class="field-body" />
4571 <tbody valign="top">
4572 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
4573 </tr>
4574 </tbody>
4575 </table>
4576 <p>Generates a function call operator that can take in positional arguments,
4577 composed arguments, named arguments, and deduced arguments.</p>
4578 <table class="docutils field-list" frame="void" rules="none">
4579 <col class="field-name" />
4580 <col class="field-body" />
4581 <tbody valign="top">
4582 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
4583 </tr>
4584 </tbody>
4585 </table>
4586 <p>Define the named parameters that will comprise the argument specification that
4587 this macro will use.  Ensure that all their tag types are in the same
4588 namespace, which is <tt class="docutils literal">tag</tt> by default.</p>
4589 <pre class="literal-block">
4590 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(y)
4591 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(z)
4592 </pre>
4593 <p>Use the macro as a substitute for a normal function call operator
4594 header.  Enclose the return type in parentheses.  For each parameter, also
4595 enclose the expected value type in parentheses.  Since the value types are
4596 mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
4597 clause.  This is especially useful when implementing multiple
4598 Boost.Parameter-enabled function call operator overloads.</p>
4599 <pre class="literal-block">
4600 class char_reader
4601 {
4602     int index;
4603     char const* key;
4604
4605  public:
4606     explicit char_reader(char const* k) : index(0), key(k)
4607     {
4608     }
4609
4610     BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR((void), tag,
4611         (deduced
4612             (required
4613                 (y, (int))
4614                 (z, (char const*))
4615             )
4616         )
4617     )
4618     {
4619         this-&gt;index = args[_y];
4620         this-&gt;key = args[_z];
4621     }
4622
4623     <a class="reference internal" href="#boost-parameter-basic-const-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR</tt></a>((char), tag,
4624         (deduced
4625             (required
4626                 (y, (bool))
4627                 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt;))
4628             )
4629         )
4630     )
4631     {
4632         return args[_y] ? (
4633             (args[_z].find(this-&gt;key)-&gt;second)[this-&gt;index]
4634         ) : this-&gt;key[this-&gt;index];
4635     }
4636 };
4637 </pre>
4638 <p>As with regular argument-dependent lookup, the value types of the arguments
4639 passed in determine which function call operator overload gets invoked.</p>
4640 <pre class="literal-block">
4641 char const* keys[] = {&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;};
4642 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a>&lt;char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>&gt; k2s;
4643 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;qux&quot;);
4644 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;wmb&quot;);
4645 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>(&quot;zxc&quot;);
4646 char_reader r(keys[0]);
4647
4648 // positional arguments
4649 BOOST_TEST_EQ('q', (r(true, k2s)));
4650 BOOST_TEST_EQ('f', (r(false, k2s)));
4651
4652 // named arguments
4653 r(_z = keys[1], _y = 1);
4654 BOOST_TEST_EQ('m', (r(_z = k2s, _y = true)));
4655 BOOST_TEST_EQ('a', (r(_z = k2s, _y = false)));
4656
4657 // deduced arguments
4658 r(keys[2], 2);
4659 BOOST_TEST_EQ('c', (r(k2s, true)));
4660 BOOST_TEST_EQ('z', (r(k2s, false)));
4661 </pre>
4662 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
4663 <p><strong>Macro parameters:</strong></p>
4664 <ul class="simple">
4665 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
4666 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
4667 function call operator resides.</li>
4668 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
4669 <em>argument-specifiers</em>, as defined below.</li>
4670 </ul>
4671 <p><strong>Argument specifiers syntax:</strong></p>
4672 <pre class="literal-block">
4673 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4674
4675 specifier-group0 ::= <em>specifier-group1</em> |
4676     (
4677         '<strong>(</strong>' '<strong>deduced</strong>'
4678             <em>specifier-group1</em> {<em>specifier-group1</em>}
4679         '<strong>)</strong>'
4680     )
4681
4682 specifier-group1 ::=
4683     (
4684         '<strong>(</strong>' '<strong>optional</strong>'
4685             <em>specifier</em> {<em>specifier</em>}
4686         '<strong>)</strong>'
4687     ) | (
4688         '<strong>(</strong>' '<strong>required</strong>'
4689             <em>specifier</em> {<em>specifier</em>}
4690         '<strong>)</strong>'
4691     )
4692
4693 specifier ::=
4694     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4695
4696 restriction ::=
4697     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4698     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4699     '<strong>*</strong>'
4700 </pre>
4701 <ul class="simple">
4702 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
4703 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
4704 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
4705 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
4706 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
4707 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
4708 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
4709 Metafunction Class</a> whose first argument will be the type of the
4710 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
4711 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
4712 </ul>
4713 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
4714 function body to determine the default value of all optional arguments.</p>
4715 <p><strong>Approximate expansion:</strong></p>
4716 <p>Where:</p>
4717 <ul class="simple">
4718 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4719 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
4720 </ul>
4721 <pre class="literal-block">
4722 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
4723 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
4724 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
4725 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
4726 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
4727 template &lt;typename Args&gt;
4728 using boost_param_result_ ## __LINE__ ## operator = <strong>result</strong>;
4729
4730 // If <strong>result</strong> is a simple return type:
4731 template &lt;typename Args&gt;
4732 struct boost_param_result_ ## __LINE__ ## operator
4733 {
4734     typedef <strong>result</strong> type;
4735 };
4736
4737 struct boost_param_params_ ## __LINE__ ## operator
4738   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
4739         <em>list of parameter specifications, based on arguments</em>
4740     &gt;
4741 {
4742 };
4743
4744 typedef boost_param_params_ ## __LINE__ ## operator
4745     boost_param_parameters_ ## __LINE__ ## operator;
4746
4747 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
4748 <strong>result</strong> operator()(
4749     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
4750   , typename boost_param_parameters_ ## __LINE__ ## operator::match&lt;
4751         A0, …, A ## <strong>n</strong>
4752     &gt;::type = boost_param_parameters_ ## __LINE__ ## operator()
4753 )
4754 {
4755     return this-&gt;boost_param_impl ## __LINE__ ## operator(
4756         boost_param_parameters_ ## __LINE__ ## operator()(
4757             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4758           , …
4759           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
4760         )
4761     );
4762 }
4763
4764 <span class="vellipsis">⋮</span>
4765
4766 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
4767 <strong>result</strong> operator()(
4768     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
4769   , typename boost_param_parameters_ ## __LINE__ ## operator::match&lt;
4770         A0, …, A ## <strong>m</strong>
4771     &gt;::type = boost_param_parameters_ ## __LINE__ ## operator()
4772 )
4773 {
4774     return this-&gt;boost_param_impl ## __LINE__ ## operator(
4775         boost_param_parameters_ ## __LINE__ ## operator()(
4776             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
4777           , …
4778           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
4779         )
4780     );
4781 }
4782
4783 template &lt;typename Args&gt;
4784 typename boost_param_result_ ## __LINE__ ## operator&lt;Args&gt;::type
4785     boost_param_impl ## __LINE__ ## operator(Args const&amp; args)
4786 </pre>
4787 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
4788 available for use within the function call operator body.</p>
4789 </div>
4790 <div class="section" id="boost-parameter-basic-const-function-call-operator-result-tag-ns-args">
4791 <span id="boost-parameter-basic-const-function-call-operator"></span><h2><a class="toc-backref" href="#id67">7.11&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, args)</tt></a></h2>
4792 <table class="docutils field-list" frame="void" rules="none">
4793 <col class="field-name" />
4794 <col class="field-body" />
4795 <tbody valign="top">
4796 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor.hpp">boost/parameter/preprocessor.hpp</a></td>
4797 </tr>
4798 </tbody>
4799 </table>
4800 <p>Generates a function call operator that can take in positional arguments,
4801 composed arguments, named arguments, and deduced arguments.</p>
4802 <table class="docutils field-list" frame="void" rules="none">
4803 <col class="field-name" />
4804 <col class="field-body" />
4805 <tbody valign="top">
4806 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
4807 </tr>
4808 </tbody>
4809 </table>
4810 <p>The return type of each of the following function templates falls under a
4811 different value category.</p>
4812 <pre class="literal-block">
4813 template &lt;std::size_t N&gt;
4814 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
4815 {
4816     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4817 }
4818
4819 template &lt;std::size_t N&gt;
4820 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
4821 {
4822     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4823 }
4824
4825 template &lt;std::size_t N&gt;
4826 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
4827 {
4828     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4829     return lset;
4830 }
4831
4832 template &lt;std::size_t N&gt;
4833 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
4834 {
4835     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
4836     return clset;
4837 }
4838 </pre>
4839 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
4840 to return the correct value category when passed in an object returned by one
4841 of the functions defined above.  Assume that
4842 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
4843 <pre class="literal-block">
4844 enum invoked
4845 {
4846     passed_by_lvalue_reference_to_const
4847   , passed_by_lvalue_reference
4848   , passed_by_rvalue_reference_to_const
4849   , passed_by_rvalue_reference
4850 };
4851
4852 struct U
4853 {
4854     template &lt;std::size_t N&gt;
4855     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
4856     {
4857         return passed_by_lvalue_reference_to_const;
4858     }
4859
4860     template &lt;std::size_t N&gt;
4861     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
4862     {
4863         return passed_by_lvalue_reference;
4864     }
4865
4866     template &lt;std::size_t N&gt;
4867     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
4868     {
4869         return passed_by_rvalue_reference_to_const;
4870     }
4871
4872     template &lt;std::size_t N&gt;
4873     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
4874     {
4875         return passed_by_rvalue_reference;
4876     }
4877 };
4878 </pre>
4879 <p>Define the named parameters that will comprise the argument specification that
4880 this macro will use.  Ensure that all their tag types are in the same
4881 namespace, which is <tt class="docutils literal">kw</tt> in this case.  The identifiers with leading
4882 underscores can be passed to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4883 same argument to which the corresponding named parameter (without underscores)
4884 is bound, as will be shown later.</p>
4885 <pre class="literal-block">
4886 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw) in(lrc))
4887 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw) in_out(lr))
4888 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw) in(rrc))
4889 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw) consume(rr))
4890 </pre>
4891 <p>Use the macro as a substitute for a normal <tt class="docutils literal">const</tt> function call operator
4892 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  For each parameter,
4893 also enclose the expected value type in parentheses.  Since the value types
4894 are mutually exclusive, you can wrap the parameters in a <tt class="docutils literal">(deduced …)</tt>
4895 clause.  Otherwise, just as with a normal function, the order in which you
4896 specify the parameters determines their position.  However, unlike a normal
4897 function, default values must be specified within the function body.  Also
4898 within the function body, you must pass the matching identifier with the
4899 leading underscore to the bracket operator of <tt class="docutils literal">args</tt> to extract the
4900 corresponding argument, but at least this doesn't require <tt class="docutils literal"><span class="pre">std::forward</span></tt> to
4901 preserve value categories.</p>
4902 <pre class="literal-block">
4903 struct B
4904 {
4905     B()
4906     {
4907     }
4908
4909     BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
4910         (deduced
4911             (required
4912                 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;1&gt;))
4913                 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;2&gt;))
4914             )
4915             (optional
4916                 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;3&gt;))
4917                 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;4&gt;))
4918             )
4919         )
4920     )
4921     {
4922         BOOST_TEST_EQ(
4923             passed_by_lvalue_reference_to_const
4924           , U::evaluate_category&lt;0&gt;(args[_lrc])
4925         );
4926         BOOST_TEST_EQ(
4927             passed_by_lvalue_reference
4928           , U::evaluate_category&lt;1&gt;(args[_lr])
4929         );
4930         BOOST_TEST_EQ(
4931             passed_by_rvalue_reference_to_const
4932           , U::evaluate_category&lt;2&gt;(
4933                 args[_rrc0 | rvalue_const_bitset&lt;2&gt;()]
4934             )
4935         );
4936         BOOST_TEST_EQ(
4937             passed_by_rvalue_reference
4938           , U::evaluate_category&lt;3&gt;(
4939                 args[_rr0 | rvalue_bitset&lt;3&gt;()]
4940             )
4941         );
4942
4943         return true;
4944     }
4945 };
4946 </pre>
4947 <p>The following function calls are legal.</p>
4948 <pre class="literal-block">
4949 B const b = B();
4950 b(  // positional arguments
4951     lvalue_const_bitset&lt;0&gt;()
4952   , lvalue_bitset&lt;1&gt;()
4953   , rvalue_const_bitset&lt;2&gt;()
4954   , rvalue_bitset&lt;3&gt;()
4955 );
4956 b(  // positional arguments
4957     lvalue_const_bitset&lt;0&gt;()
4958   , lvalue_bitset&lt;1&gt;()
4959 );
4960 b((  // composed arguments
4961     _rr0 = rvalue_bitset&lt;3&gt;()
4962   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4963   , _lr0 = lvalue_bitset&lt;1&gt;()
4964   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4965 ));
4966 b(  // named arguments
4967     _rr0 = rvalue_bitset&lt;3&gt;()
4968   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4969   , _lr0 = lvalue_bitset&lt;1&gt;()
4970   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
4971 );
4972 b(  // named arguments
4973     _lr0 = lvalue_bitset&lt;1&gt;()
4974   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
4975 );
4976 </pre>
4977 <p>Because the parameters were wrapped in a <tt class="docutils literal">(deduced …)</tt> clause, the following
4978 function calls are also legal.</p>
4979 <pre class="literal-block">
4980 b(  // deduced arguments
4981     rvalue_bitset&lt;3&gt;()
4982   , lvalue_const_bitset&lt;0&gt;()
4983   , lvalue_bitset&lt;1&gt;()
4984   , rvalue_const_bitset&lt;2&gt;()
4985 );
4986 b(  // deduced arguments
4987     lvalue_bitset&lt;1&gt;()
4988   , lvalue_const_bitset&lt;0&gt;()
4989 );
4990 </pre>
4991 <p>The <a class="reference external" href="../../test/preprocessor.cpp">preprocessor.cpp</a> test program demonstrates proper usage of this macro.</p>
4992 <p><strong>Macro parameters:</strong></p>
4993 <ul class="simple">
4994 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
4995 <li><tt class="docutils literal">tag_namespace</tt> is the namespace in which the keywords used by the
4996 function call operator resides.</li>
4997 <li><tt class="docutils literal">arguments</tt> is a <a class="reference external" href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a> <a class="reference external" href="../../../preprocessor/doc/data/sequences.html">sequence</a> of
4998 <em>argument-specifiers</em>, as defined below.</li>
4999 </ul>
5000 <p><strong>Argument specifiers syntax:</strong></p>
5001 <pre class="literal-block">
5002 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
5003
5004 specifier-group0 ::= <em>specifier-group1</em> |
5005     (
5006         '<strong>(</strong>' '<strong>deduced</strong>'
5007             <em>specifier-group1</em> {<em>specifier-group1</em>}
5008         '<strong>)</strong>'
5009     )
5010
5011 specifier-group1 ::=
5012     (
5013         '<strong>(</strong>' '<strong>optional</strong>'
5014             <em>specifier</em> {<em>specifier</em>}
5015         '<strong>)</strong>'
5016     ) | (
5017         '<strong>(</strong>' '<strong>required</strong>'
5018             <em>specifier</em> {<em>specifier</em>}
5019         '<strong>)</strong>'
5020     )
5021
5022 specifier ::=
5023     '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
5024
5025 restriction ::=
5026     ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
5027     ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
5028     '<strong>*</strong>'
5029 </pre>
5030 <ul class="simple">
5031 <li><tt class="docutils literal"><span class="pre">argument-name</span></tt> is any valid C++ identifier.</li>
5032 <li><tt class="docutils literal">mfc</tt> is an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary Metafunction Class</a> whose first argument will
5033 be the type of the corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument
5034 will be the entire <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is a <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean
5035 Integral Constant</a>; however, user code <em>cannot</em> compute <tt class="docutils literal">mfc</tt> in terms
5036 of <tt class="docutils literal"><span class="pre">previous-name</span> ## _type</tt>.</li>
5037 <li><tt class="docutils literal"><span class="pre">type-name</span></tt> is either the name of a <strong>target type</strong> or an <a class="reference external" href="../../../mpl/doc/refmanual/metafunction-class.html">MPL Binary
5038 Metafunction Class</a> whose first argument will be the type of the
5039 corresponding <tt class="docutils literal"><span class="pre">argument-name</span></tt>, whose second argument will be the entire
5040 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>, and whose return type is the <strong>target type</strong>.</li>
5041 </ul>
5042 <p>Note that <em>specifier</em> does not include <em>default-value</em>.  It is up to the
5043 function body to determine the default value of all optional arguments.</p>
5044 <p><strong>Approximate expansion:</strong></p>
5045 <p>Where:</p>
5046 <ul class="simple">
5047 <li><tt class="docutils literal">n</tt> denotes the <em>minimum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
5048 <li><tt class="docutils literal">m</tt> denotes the <em>maximum</em> arity, as determined from <tt class="docutils literal">arguments</tt>.</li>
5049 </ul>
5050 <pre class="literal-block">
5051 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
5052 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
5053 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
5054 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
5055 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
5056 template &lt;typename Args&gt;
5057 using boost_param_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
5058
5059 // If <strong>result</strong> is a simple return type:
5060 template &lt;typename Args&gt;
5061 struct boost_param_result_const_ ## __LINE__ ## operator
5062 {
5063     typedef <strong>result</strong> type;
5064 };
5065
5066 struct boost_param_params_const_ ## __LINE__ ## operator
5067   : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
5068         <em>list of parameter specifications, based on arguments</em>
5069     &gt;
5070 {
5071 };
5072
5073 typedef boost_param_params_const_ ## __LINE__ ## operator
5074     boost_param_parameters_const_ ## __LINE__ ## operator;
5075
5076 template &lt;typename A0, …, typename A ## <strong>n</strong>&gt;
5077 <strong>result</strong> operator()(
5078     A0&amp;&amp; a0, …, A ## <strong>n</strong>&amp;&amp; a ## <strong>n</strong>
5079   , typename boost_param_parameters_const_ ## __LINE__ ## operator
5080     ::match&lt;A0, …, A ## <strong>n</strong>&gt;::type
5081     = boost_param_parameters_const_ ## __LINE__ ## operator()
5082 ) const
5083 {
5084     return this-&gt;boost_param_impl_const ## __LINE__ ## operator(
5085         boost_param_parameters_const_ ## __LINE__ ## operator()(
5086             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
5087           , …
5088           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>n</strong>&gt;(a ## <strong>n</strong>)
5089         )
5090     );
5091 }
5092
5093 <span class="vellipsis">⋮</span>
5094
5095 template &lt;typename A0, …, typename A ## <strong>m</strong>&gt;
5096 <strong>result</strong> operator()(
5097     A0&amp;&amp; a0, …, A ## <strong>m</strong>&amp;&amp; a ## <strong>m</strong>
5098   , typename boost_param_parameters_const_ ## __LINE__ ## operator
5099     ::match&lt;A0, …, A ## <strong>m</strong>&gt;::type
5100     = boost_param_parameters_const_ ## __LINE__ ## operator()
5101 ) const
5102 {
5103     return this-&gt;boost_param_impl_const ## __LINE__ ## operator(
5104         boost_param_parameters_const_ ## __LINE__ ## operator()(
5105             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A0&gt;(a0)
5106           , …
5107           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>m</strong>&gt;(a ## <strong>m</strong>)
5108         )
5109     );
5110 }
5111
5112 template &lt;typename Args&gt;
5113 typename boost_param_result_const_ ## __LINE__ ## operator&lt;Args&gt;::type
5114     boost_param_impl_const ## __LINE__ ## operator(Args const&amp; args) const
5115 </pre>
5116 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
5117 available for use within the function call operator body.</p>
5118 </div>
5119 <div class="section" id="boost-parameter-no-spec-function-result-name">
5120 <span id="boost-parameter-no-spec-function"></span><h2><a class="toc-backref" href="#id68">7.12&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION(result, name)</tt></a></h2>
5121 <table class="docutils field-list" frame="void" rules="none">
5122 <col class="field-name" />
5123 <col class="field-body" />
5124 <tbody valign="top">
5125 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
5126 </tr>
5127 </tbody>
5128 </table>
5129 <p>Generates a function that can take in named arguments.</p>
5130 <table class="docutils field-list" frame="void" rules="none">
5131 <col class="field-name" />
5132 <col class="field-body" />
5133 <tbody valign="top">
5134 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
5135 </tr>
5136 </tbody>
5137 </table>
5138 <p>The return type of each of the following function templates falls under a
5139 different value category.</p>
5140 <pre class="literal-block">
5141 template &lt;std::size_t N&gt;
5142 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
5143 {
5144     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5145 }
5146
5147 template &lt;std::size_t N&gt;
5148 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
5149 {
5150     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5151 }
5152
5153 template &lt;std::size_t N&gt;
5154 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
5155 {
5156     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5157     return lset;
5158 }
5159
5160 template &lt;std::size_t N&gt;
5161 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
5162 {
5163     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5164     return clset;
5165 }
5166 </pre>
5167 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
5168 to return the correct value category when passed in an object returned by one
5169 of the functions defined above.  Assume that
5170 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
5171 <pre class="literal-block">
5172 enum invoked
5173 {
5174     passed_by_lvalue_reference_to_const
5175   , passed_by_lvalue_reference
5176   , passed_by_rvalue_reference_to_const
5177   , passed_by_rvalue_reference
5178 };
5179
5180 struct U
5181 {
5182     template &lt;std::size_t N&gt;
5183     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
5184     {
5185         return passed_by_lvalue_reference_to_const;
5186     }
5187
5188     template &lt;std::size_t N&gt;
5189     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
5190     {
5191         return passed_by_lvalue_reference;
5192     }
5193
5194     template &lt;std::size_t N&gt;
5195     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
5196     {
5197         return passed_by_rvalue_reference_to_const;
5198     }
5199
5200     template &lt;std::size_t N&gt;
5201     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
5202     {
5203         return passed_by_rvalue_reference;
5204     }
5205 };
5206 </pre>
5207 <p>Named parameters are required when invoking the function; however, none of
5208 their tags need to be in the same namespace.</p>
5209 <pre class="literal-block">
5210 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw0) in(lrc))
5211 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw1) in_out(lr))
5212 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw2) in(rrc))
5213 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw3) consume(rr))
5214 </pre>
5215 <p>Use the macro as a substitute for a variadic function header.  Enclose the
5216 return type <tt class="docutils literal">bool</tt> in parentheses.</p>
5217 <pre class="literal-block">
5218 BOOST_PARAMETER_NO_SPEC_FUNCTION((bool), evaluate)
5219 {
5220     BOOST_TEST_EQ(
5221         passed_by_lvalue_reference_to_const
5222       , U::evaluate_category&lt;0&gt;(args[_lrc])
5223     );
5224     BOOST_TEST_EQ(
5225         passed_by_lvalue_reference
5226       , U::evaluate_category&lt;1&gt;(args[_lr])
5227     );
5228     BOOST_TEST_EQ(
5229         passed_by_rvalue_reference_to_const
5230       , U::evaluate_category&lt;2&gt;(
5231             args[_rrc | rvalue_const_bitset&lt;2&gt;()]
5232         )
5233     );
5234     BOOST_TEST_EQ(
5235         passed_by_rvalue_reference
5236       , U::evaluate_category&lt;3&gt;(args[_rr | rvalue_bitset&lt;3&gt;()])
5237     );
5238
5239     return true;
5240 }
5241 </pre>
5242 <p>To invoke the function, bind all its arguments to named parameters.</p>
5243 <pre class="literal-block">
5244 evaluate(
5245     _rr0 = rvalue_bitset&lt;3&gt;()
5246   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
5247   , _lr0 = lvalue_bitset&lt;1&gt;()
5248   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
5249 );
5250 evaluate(
5251     _lr0 = lvalue_bitset&lt;1&gt;()
5252   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
5253 );
5254 </pre>
5255 <p>The <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test program demonstrates proper usage of
5256 this macro.</p>
5257 <p><strong>Macro parameters:</strong></p>
5258 <ul class="simple">
5259 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
5260 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
5261 generated implementation function.</li>
5262 </ul>
5263 <p><strong>Argument specifiers syntax:</strong></p>
5264 <p>None.</p>
5265 <p><strong>Approximate expansion:</strong></p>
5266 <pre class="literal-block">
5267 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
5268 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
5269 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
5270 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
5271 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
5272 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5273 using boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5274
5275 // If <strong>result</strong> is a simple return type:
5276 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5277 struct boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>
5278 {
5279     typedef <strong>result</strong> type;
5280 };
5281
5282 template &lt;typename ResultType, typename Args&gt;
5283 ResultType
5284     boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5285         (ResultType(*)())
5286       , Args const&amp; args
5287     );
5288
5289 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5290 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>&lt;
5291     <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
5292   , boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>&lt;
5293         TaggedArg0
5294       , TaggedArgs...
5295     &gt;
5296 &gt;::type
5297     <strong>name</strong>(TaggedArg0 const&amp; arg0, TaggedArgs const&amp;... args)
5298 {
5299     return boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5300         static_cast&lt;
5301             typename
5302             boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>&lt;
5303                 TaggedArg0
5304               , TaggedArgs...
5305             &gt;::type(*)()
5306         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
5307       , <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...)
5308     );
5309 }
5310
5311 template &lt;typename ResultType, typename Args&gt;
5312 ResultType
5313     boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5314         (ResultType(*)())
5315       , Args const&amp; args
5316     )
5317 </pre>
5318 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
5319 available for use within the function body.</p>
5320 </div>
5321 <div class="section" id="boost-parameter-no-spec-member-function-result-name">
5322 <span id="boost-parameter-no-spec-member-function"></span><h2><a class="toc-backref" href="#id69">7.13&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, name)</tt></a></h2>
5323 <table class="docutils field-list" frame="void" rules="none">
5324 <col class="field-name" />
5325 <col class="field-body" />
5326 <tbody valign="top">
5327 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
5328 </tr>
5329 </tbody>
5330 </table>
5331 <p>Generates a member function that can take in named arguments.</p>
5332 <table class="docutils field-list" frame="void" rules="none">
5333 <col class="field-name" />
5334 <col class="field-body" />
5335 <tbody valign="top">
5336 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
5337 </tr>
5338 </tbody>
5339 </table>
5340 <p>When designing a front-end class template whose back-end is configurable via
5341 parameterized inheritance, it can be useful to omit argument specifiers from
5342 a named-parameter member function so that the delegate member functions of the
5343 back-end classes can enforce their own specifications.</p>
5344 <pre class="literal-block">
5345 template &lt;typename B&gt;
5346 struct frontend : B
5347 {
5348     frontend() : B()
5349     {
5350     }
5351
5352     BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION((void), initialize)
5353     {
5354         this-&gt;initialize_impl(args);
5355     }
5356 };
5357 </pre>
5358 <p>Named parameters are required when invoking the member function; however, none
5359 of their tags need to be in the same namespace.</p>
5360 <pre class="literal-block">
5361 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a0)
5362 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a1)
5363 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a2)
5364 </pre>
5365 <p>For this example, each of the back-end class templates requires its own
5366 parameter to be present in the argument pack.  In practice, such parameters
5367 should be optional, with default values.</p>
5368 <pre class="literal-block">
5369 template &lt;typename T&gt;
5370 class backend0
5371 {
5372     T a0;
5373
5374  public:
5375     backend0() : a0()
5376     {
5377     }
5378
5379     T const&amp; get_a0() const
5380     {
5381         return this-&gt;a0;
5382     }
5383
5384  protected:
5385     template &lt;typename ArgPack&gt;
5386     void initialize_impl(ArgPack const&amp; args)
5387     {
5388         this-&gt;a0 = args[_a0];
5389     }
5390 };
5391
5392 template &lt;typename B, typename T&gt;
5393 class backend1 : public B
5394 {
5395     T a1;
5396
5397  public:
5398     backend1() : B(), a1()
5399     {
5400     }
5401
5402     T const&amp; get_a1() const
5403     {
5404         return this-&gt;a1;
5405     }
5406
5407  protected:
5408     template &lt;typename ArgPack&gt;
5409     void initialize_impl(ArgPack const&amp; args)
5410     {
5411         B::initialize_impl(args);
5412         this-&gt;a1 = args[_a1];
5413     }
5414 };
5415
5416 template &lt;typename B, typename T&gt;
5417 class backend2 : public B
5418 {
5419     T a2;
5420
5421  public:
5422     backend2() : B(), a2()
5423     {
5424     }
5425
5426     T const&amp; get_a2() const
5427     {
5428         return this-&gt;a2;
5429     }
5430
5431  protected:
5432     template &lt;typename ArgPack&gt;
5433     void initialize_impl(ArgPack const&amp; args)
5434     {
5435         B::initialize_impl(args);
5436         this-&gt;a2 = args[_a2];
5437     }
5438 };
5439 </pre>
5440 <p>This example shows that while <tt class="docutils literal">backend0</tt> must always be the root base class
5441 template and that <tt class="docutils literal">frontend</tt> must always be the most derived class template,
5442 the other back-ends can be chained together in different orders.</p>
5443 <pre class="literal-block">
5444 char const* p = &quot;foo&quot;;
5445 frontend&lt;
5446     backend2&lt;backend1&lt;backend0&lt;char const*&gt;, char&gt;, int&gt;
5447 &gt; composed_obj0;
5448 frontend&lt;
5449     backend1&lt;backend2&lt;backend0&lt;char const*&gt;, int&gt;, char&gt;
5450 &gt; composed_obj1;
5451 composed_obj0.initialize(_a2 = 4, _a1 = ' ', _a0 = p);
5452 composed_obj1.initialize(_a0 = p, _a1 = ' ', _a2 = 4);
5453 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
5454 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
5455 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
5456 </pre>
5457 <p>The <a class="reference external" href="../../test/parameterized_inheritance.cpp">parameterized_inheritance.cpp</a> and <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test
5458 programs demonstrate proper usage of this macro.</p>
5459 <p><strong>Macro parameters:</strong></p>
5460 <ul class="simple">
5461 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
5462 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
5463 generated implementation function.  <tt class="docutils literal">name</tt> may be qualified by the
5464 <tt class="docutils literal">static</tt> keyword to declare the member function and its helpers as not
5465 associated with any object of the enclosing type.</li>
5466 </ul>
5467 <p><strong>Argument specifiers syntax:</strong></p>
5468 <p>None.</p>
5469 <p><strong>Approximate expansion:</strong></p>
5470 <pre class="literal-block">
5471 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
5472 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
5473 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
5474 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
5475 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
5476 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5477 using boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5478
5479 // If <strong>result</strong> is a simple return type:
5480 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5481 struct boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>
5482 {
5483     typedef <strong>result</strong> type;
5484 };
5485
5486 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5487 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>&lt;
5488     <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
5489   , boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>&lt;
5490         TaggedArg0
5491       , TaggedArgs...
5492     &gt;
5493 &gt;::type
5494     <strong>name</strong>(TaggedArg0 const&amp; arg0, TaggedArgs const&amp;... args)
5495 {
5496     return this-&gt;boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5497         static_cast&lt;
5498             typename
5499             boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>&lt;
5500                 TaggedArg0
5501               , TaggedArgs...
5502             &gt;::type(*)()
5503         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
5504       , <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...)
5505     );
5506 }
5507
5508 template &lt;typename ResultType, typename Args&gt;
5509 ResultType
5510     boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5511         (ResultType(*)())
5512       , Args const&amp; args
5513     )
5514 </pre>
5515 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
5516 available for use within the function body.</p>
5517 </div>
5518 <div class="section" id="boost-parameter-no-spec-const-member-function-result-name">
5519 <span id="boost-parameter-no-spec-const-member-function"></span><h2><a class="toc-backref" href="#id70">7.14&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, name)</tt></a></h2>
5520 <table class="docutils field-list" frame="void" rules="none">
5521 <col class="field-name" />
5522 <col class="field-body" />
5523 <tbody valign="top">
5524 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
5525 </tr>
5526 </tbody>
5527 </table>
5528 <p>Generates a member function that can take in named arguments.</p>
5529 <table class="docutils field-list" frame="void" rules="none">
5530 <col class="field-name" />
5531 <col class="field-body" />
5532 <tbody valign="top">
5533 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
5534 </tr>
5535 </tbody>
5536 </table>
5537 <p>The return type of each of the following function templates falls under a
5538 different value category.</p>
5539 <pre class="literal-block">
5540 template &lt;std::size_t N&gt;
5541 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
5542 {
5543     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5544 }
5545
5546 template &lt;std::size_t N&gt;
5547 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
5548 {
5549     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5550 }
5551
5552 template &lt;std::size_t N&gt;
5553 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
5554 {
5555     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5556     return lset;
5557 }
5558
5559 template &lt;std::size_t N&gt;
5560 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
5561 {
5562     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5563     return clset;
5564 }
5565 </pre>
5566 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
5567 to return the correct value category when passed in an object returned by one
5568 of the functions defined above.  Assume that
5569 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
5570 <pre class="literal-block">
5571 enum invoked
5572 {
5573     passed_by_lvalue_reference_to_const
5574   , passed_by_lvalue_reference
5575   , passed_by_rvalue_reference_to_const
5576   , passed_by_rvalue_reference
5577 };
5578
5579 struct U
5580 {
5581     template &lt;std::size_t N&gt;
5582     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
5583     {
5584         return passed_by_lvalue_reference_to_const;
5585     }
5586
5587     template &lt;std::size_t N&gt;
5588     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
5589     {
5590         return passed_by_lvalue_reference;
5591     }
5592
5593     template &lt;std::size_t N&gt;
5594     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
5595     {
5596         return passed_by_rvalue_reference_to_const;
5597     }
5598
5599     template &lt;std::size_t N&gt;
5600     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
5601     {
5602         return passed_by_rvalue_reference;
5603     }
5604 };
5605 </pre>
5606 <p>Named parameters are required when invoking the member function; however, none
5607 of their tags need to be in the same namespace.</p>
5608 <pre class="literal-block">
5609 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw0) in(lrc))
5610 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw1) in_out(lr))
5611 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw2) in(rrc))
5612 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw3) consume(rr))
5613 </pre>
5614 <p>Use the macro as a substitute for a variadic function header.  Enclose the
5615 return type <tt class="docutils literal">bool</tt> in parentheses.  The macro will qualify the function with
5616 the <tt class="docutils literal">const</tt> keyword.</p>
5617 <pre class="literal-block">
5618 struct D
5619 {
5620     D()
5621     {
5622     }
5623
5624     BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION((bool), evaluate_m)
5625     {
5626         BOOST_TEST_EQ(
5627             passed_by_lvalue_reference_to_const
5628           , U::evaluate_category&lt;0&gt;(args[_lrc])
5629         );
5630         BOOST_TEST_EQ(
5631             passed_by_lvalue_reference
5632           , U::evaluate_category&lt;1&gt;(args[_lr])
5633         );
5634         BOOST_TEST_EQ(
5635             passed_by_rvalue_reference_to_const
5636           , U::evaluate_category&lt;2&gt;(
5637                 args[_rrc | rvalue_const_bitset&lt;2&gt;()]
5638             )
5639         );
5640         BOOST_TEST_EQ(
5641             passed_by_rvalue_reference
5642           , U::evaluate_category&lt;3&gt;(
5643                 args[_rr | rvalue_bitset&lt;3&gt;()]
5644             )
5645         );
5646
5647         return true;
5648     }
5649 };
5650 </pre>
5651 <p>To invoke the member function, bind all its arguments to named parameters.</p>
5652 <pre class="literal-block">
5653 D const d = D();
5654 d.evaluate_m(
5655     _rr0 = rvalue_bitset&lt;3&gt;()
5656   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
5657   , _lr0 = lvalue_bitset&lt;1&gt;()
5658   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
5659 );
5660 d.evaluate_m(
5661     _lr0 = lvalue_bitset&lt;1&gt;()
5662   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
5663 );
5664 </pre>
5665 <p>The <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test program demonstrates proper usage of
5666 this macro.</p>
5667 <p><strong>Macro parameters:</strong></p>
5668 <ul class="simple">
5669 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function.</li>
5670 <li><tt class="docutils literal">name</tt> is the base name of the function; it determines the name of the
5671 generated implementation function.</li>
5672 </ul>
5673 <p><strong>Argument specifiers syntax:</strong></p>
5674 <p>None.</p>
5675 <p><strong>Approximate expansion:</strong></p>
5676 <pre class="literal-block">
5677 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
5678 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
5679 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
5680 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
5681 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
5682 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5683 using boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5684
5685 // If <strong>result</strong> is a simple return type:
5686 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5687 struct boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong>
5688 {
5689     typedef <strong>result</strong> type;
5690 };
5691
5692 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5693 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>&lt;
5694     <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
5695   , boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong>&lt;
5696         TaggedArg0
5697       , TaggedArgs...
5698     &gt;
5699 &gt;::type
5700     <strong>name</strong>(TaggedArg0 const&amp; arg0, TaggedArgs const&amp;... args) const
5701 {
5702     return this-&gt;boost_param_no_spec_impl_const ## __LINE__ ## <strong>name</strong>(
5703         static_cast&lt;
5704             typename
5705             boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong>&lt;
5706                 TaggedArg0
5707               , TaggedArgs...
5708             &gt;::type(*)()
5709         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
5710       , <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...)
5711     );
5712 }
5713
5714 template &lt;typename ResultType, typename Args&gt;
5715 ResultType
5716     boost_param_no_spec_impl_const ## __LINE__ ## <strong>name</strong>(
5717         (ResultType(*)())
5718       , Args const&amp; args
5719     ) const
5720 </pre>
5721 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
5722 available for use within the function body.</p>
5723 </div>
5724 <div class="section" id="boost-parameter-no-spec-function-call-operator-result">
5725 <span id="boost-parameter-no-spec-function-call-operator"></span><h2><a class="toc-backref" href="#id71">7.15&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result)</tt></a></h2>
5726 <table class="docutils field-list" frame="void" rules="none">
5727 <col class="field-name" />
5728 <col class="field-body" />
5729 <tbody valign="top">
5730 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
5731 </tr>
5732 </tbody>
5733 </table>
5734 <p>Generates a function call operator that can take in named arguments.</p>
5735 <table class="docutils field-list" frame="void" rules="none">
5736 <col class="field-name" />
5737 <col class="field-body" />
5738 <tbody valign="top">
5739 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
5740 </tr>
5741 </tbody>
5742 </table>
5743 <p>When designing a front-end class template whose back-end is configurable via
5744 parameterized inheritance, it can be useful to omit argument specifiers from
5745 a named-parameter function call operator so that the delegate member functions
5746 of the back-end classes can enforce their own specifications.</p>
5747 <pre class="literal-block">
5748 template &lt;typename B&gt;
5749 struct frontend : B
5750 {
5751     frontend() : B()
5752     {
5753     }
5754
5755     BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR((void))
5756     {
5757         this-&gt;initialize_impl(args);
5758     }
5759 };
5760 </pre>
5761 <p>Named parameters are required when invoking the function call operator;
5762 however, none of their tags need to be in the same namespace.</p>
5763 <pre class="literal-block">
5764 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a0)
5765 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a1)
5766 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a2)
5767 </pre>
5768 <p>For this example, each of the back-end class templates requires its own
5769 parameter to be present in the argument pack.  In practice, such parameters
5770 should be optional, with default values.</p>
5771 <pre class="literal-block">
5772 template &lt;typename T&gt;
5773 class backend0
5774 {
5775     T a0;
5776
5777  public:
5778     backend0() : a0()
5779     {
5780     }
5781
5782     T const&amp; get_a0() const
5783     {
5784         return this-&gt;a0;
5785     }
5786
5787  protected:
5788     template &lt;typename ArgPack&gt;
5789     void initialize_impl(ArgPack const&amp; args)
5790     {
5791         this-&gt;a0 = args[_a0];
5792     }
5793 };
5794
5795 template &lt;typename B, typename T&gt;
5796 class backend1 : public B
5797 {
5798     T a1;
5799
5800  public:
5801     backend1() : B(), a1()
5802     {
5803     }
5804
5805     T const&amp; get_a1() const
5806     {
5807         return this-&gt;a1;
5808     }
5809
5810  protected:
5811     template &lt;typename ArgPack&gt;
5812     void initialize_impl(ArgPack const&amp; args)
5813     {
5814         B::initialize_impl(args);
5815         this-&gt;a1 = args[_a1];
5816     }
5817 };
5818
5819 template &lt;typename B, typename T&gt;
5820 class backend2 : public B
5821 {
5822     T a2;
5823
5824  public:
5825     backend2() : B(), a2()
5826     {
5827     }
5828
5829     T const&amp; get_a2() const
5830     {
5831         return this-&gt;a2;
5832     }
5833
5834  protected:
5835     template &lt;typename ArgPack&gt;
5836     void initialize_impl(ArgPack const&amp; args)
5837     {
5838         B::initialize_impl(args);
5839         this-&gt;a2 = args[_a2];
5840     }
5841 };
5842 </pre>
5843 <p>This example shows that while <tt class="docutils literal">backend0</tt> must always be the root base class
5844 template and that <tt class="docutils literal">frontend</tt> must always be the most derived class template,
5845 the other back-ends can be chained together in different orders.</p>
5846 <pre class="literal-block">
5847 char const* p = &quot;foo&quot;;
5848 frontend&lt;
5849     backend2&lt;backend1&lt;backend0&lt;char const*&gt;, char&gt;, int&gt;
5850 &gt; composed_obj0;
5851 frontend&lt;
5852     backend1&lt;backend2&lt;backend0&lt;char const*&gt;, int&gt;, char&gt;
5853 &gt; composed_obj1;
5854 composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
5855 composed_obj1(_a0 = p, _a1 = ' ', _a2 = 4);
5856 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
5857 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
5858 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
5859 </pre>
5860 <p>The <a class="reference external" href="../../test/parameterized_inheritance.cpp">parameterized_inheritance.cpp</a> and <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test
5861 programs demonstrate proper usage of this macro.</p>
5862 <p><strong>Macro parameters:</strong></p>
5863 <ul class="simple">
5864 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
5865 </ul>
5866 <p><strong>Argument specifiers syntax:</strong></p>
5867 <p>None.</p>
5868 <p><strong>Approximate expansion:</strong></p>
5869 <pre class="literal-block">
5870 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
5871 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
5872 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
5873 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
5874 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
5875 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5876 using boost_param_no_spec_result_ ## __LINE__ ## operator = <strong>result</strong>;
5877
5878 // If <strong>result</strong> is a simple return type:
5879 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5880 struct boost_param_no_spec_result_ ## __LINE__ ## operator
5881 {
5882     typedef <strong>result</strong> type;
5883 };
5884
5885 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
5886 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>&lt;
5887     <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
5888   , boost_param_no_spec_result_ ## __LINE__ ## operator&lt;
5889         TaggedArg0
5890       , TaggedArgs...
5891     &gt;
5892 &gt;::type
5893     operator()(TaggedArg0 const&amp; arg0, TaggedArgs const&amp;... args)
5894 {
5895     return this-&gt;boost_param_no_spec_impl ## __LINE__ ## operator(
5896         static_cast&lt;
5897             typename
5898             boost_param_no_spec_result_ ## __LINE__ ## operator&lt;
5899                 TaggedArg0
5900               , TaggedArgs...
5901             &gt;::type(*)()
5902         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
5903       , <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...)
5904     );
5905 }
5906
5907 template &lt;typename ResultType, typename Args&gt;
5908 ResultType
5909     boost_param_no_spec_impl ## __LINE__ ## operator(
5910         (ResultType(*)())
5911       , Args const&amp; args
5912     )
5913 </pre>
5914 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
5915 available for use within the function body.</p>
5916 </div>
5917 <div class="section" id="boost-parameter-no-spec-const-function-call-operator-result">
5918 <span id="boost-parameter-no-spec-const-function-call-operator"></span><h2><a class="toc-backref" href="#id72">7.16&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result)</tt></a></h2>
5919 <table class="docutils field-list" frame="void" rules="none">
5920 <col class="field-name" />
5921 <col class="field-body" />
5922 <tbody valign="top">
5923 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
5924 </tr>
5925 </tbody>
5926 </table>
5927 <p>Generates a function call operator that can take in named arguments.</p>
5928 <table class="docutils field-list" frame="void" rules="none">
5929 <col class="field-name" />
5930 <col class="field-body" />
5931 <tbody valign="top">
5932 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
5933 </tr>
5934 </tbody>
5935 </table>
5936 <p>The return type of each of the following function templates falls under a
5937 different value category.</p>
5938 <pre class="literal-block">
5939 template &lt;std::size_t N&gt;
5940 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
5941 {
5942     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5943 }
5944
5945 template &lt;std::size_t N&gt;
5946 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
5947 {
5948     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5949 }
5950
5951 template &lt;std::size_t N&gt;
5952 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
5953 {
5954     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5955     return lset;
5956 }
5957
5958 template &lt;std::size_t N&gt;
5959 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
5960 {
5961     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
5962     return clset;
5963 }
5964 </pre>
5965 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
5966 to return the correct value category when passed in an object returned by one
5967 of the functions defined above.  Assume that
5968 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
5969 <pre class="literal-block">
5970 enum invoked
5971 {
5972     passed_by_lvalue_reference_to_const
5973   , passed_by_lvalue_reference
5974   , passed_by_rvalue_reference_to_const
5975   , passed_by_rvalue_reference
5976 };
5977
5978 struct U
5979 {
5980     template &lt;std::size_t N&gt;
5981     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
5982     {
5983         return passed_by_lvalue_reference_to_const;
5984     }
5985
5986     template &lt;std::size_t N&gt;
5987     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
5988     {
5989         return passed_by_lvalue_reference;
5990     }
5991
5992     template &lt;std::size_t N&gt;
5993     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
5994     {
5995         return passed_by_rvalue_reference_to_const;
5996     }
5997
5998     template &lt;std::size_t N&gt;
5999     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
6000     {
6001         return passed_by_rvalue_reference;
6002     }
6003 };
6004 </pre>
6005 <p>Named parameters are required when invoking the function call operator;
6006 however, none of their tags need to be in the same namespace.</p>
6007 <pre class="literal-block">
6008 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw0) in(lrc))
6009 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw1) in_out(lr))
6010 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw2) in(rrc))
6011 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw3) consume(rr))
6012 </pre>
6013 <p>Use the macro as a substitute for a variadic function call operator
6014 header.  Enclose the return type <tt class="docutils literal">bool</tt> in parentheses.  The macro will
6015 qualify the function with the <tt class="docutils literal">const</tt> keyword.</p>
6016 <pre class="literal-block">
6017 struct D
6018 {
6019     D()
6020     {
6021     }
6022
6023     BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR((bool))
6024     {
6025         BOOST_TEST_EQ(
6026             passed_by_lvalue_reference_to_const
6027           , U::evaluate_category&lt;0&gt;(args[_lrc])
6028         );
6029         BOOST_TEST_EQ(
6030             passed_by_lvalue_reference
6031           , U::evaluate_category&lt;1&gt;(args[_lr])
6032         );
6033         BOOST_TEST_EQ(
6034             passed_by_rvalue_reference_to_const
6035           , U::evaluate_category&lt;2&gt;(
6036                 args[_rrc | rvalue_const_bitset&lt;2&gt;()]
6037             )
6038         );
6039         BOOST_TEST_EQ(
6040             passed_by_rvalue_reference
6041           , U::evaluate_category&lt;3&gt;(
6042                 args[_rr | rvalue_bitset&lt;3&gt;()]
6043             )
6044         );
6045
6046         return true;
6047     }
6048 };
6049 </pre>
6050 <p>To invoke the function call operator, bind all its arguments to named
6051 parameters.</p>
6052 <pre class="literal-block">
6053 D const d = D();
6054 d(
6055     _rr0 = rvalue_bitset&lt;3&gt;()
6056   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
6057   , _lr0 = lvalue_bitset&lt;1&gt;()
6058   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
6059 );
6060 d(
6061     _lr0 = lvalue_bitset&lt;1&gt;()
6062   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
6063 );
6064 </pre>
6065 <p>The <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test program demonstrates proper usage of this
6066 macro.</p>
6067 <p><strong>Macro parameters:</strong></p>
6068 <ul class="simple">
6069 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
6070 </ul>
6071 <p><strong>Argument specifiers syntax:</strong></p>
6072 <p>None.</p>
6073 <p><strong>Approximate expansion:</strong></p>
6074 <pre class="literal-block">
6075 // If <strong>result</strong> is a template instantiation of <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>,
6076 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>,
6077 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if_c</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if_c</a>,
6078 // <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if</a>, <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_disable_if_c</a>, or
6079 // <a class="reference external" href="http://en.cppreference.com/w/cpp/types/enable_if">std::enable_if</a>:
6080 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
6081 using boost_param_no_spec_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
6082
6083 // If <strong>result</strong> is a simple return type:
6084 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
6085 struct boost_param_no_spec_result_const_ ## __LINE__ ## operator
6086 {
6087     typedef <strong>result</strong> type;
6088 };
6089
6090 template &lt;typename TaggedArg0, typename ...TaggedArgs&gt;
6091 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a>&lt;
6092     <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
6093   , boost_param_no_spec_result_const_ ## __LINE__ ## operator&lt;
6094         TaggedArg0
6095       , TaggedArgs...
6096     &gt;
6097 &gt;::type
6098     operator()(
6099         TaggedArg0 const&amp; arg0
6100       , TaggedArgs const&amp;... args
6101     ) const
6102 {
6103     return this-&gt;boost_param_no_spec_impl_const ## __LINE__ ## operator(
6104         static_cast&lt;
6105             typename
6106             boost_param_no_spec_result_const_ ## __LINE__ ## operator&lt;
6107                 TaggedArg0
6108               , TaggedArgs...
6109             &gt;::type(*)()
6110         &gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
6111       , <a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...)
6112     );
6113 }
6114
6115 template &lt;typename ResultType, typename Args&gt;
6116 ResultType
6117     boost_param_no_spec_impl_const ## __LINE__ ## operator(
6118         (ResultType(*)())
6119       , Args const&amp; args
6120     ) const
6121 </pre>
6122 <p>Only the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type <tt class="docutils literal">Args</tt> and its object instance <tt class="docutils literal">args</tt> are
6123 available for use within the function body.</p>
6124 </div>
6125 <div class="section" id="boost-parameter-no-spec-constructor-cls-impl">
6126 <span id="boost-parameter-no-spec-constructor"></span><h2><a class="toc-backref" href="#id73">7.17&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(cls, impl)</tt></a></h2>
6127 <table class="docutils field-list" frame="void" rules="none">
6128 <col class="field-name" />
6129 <col class="field-body" />
6130 <tbody valign="top">
6131 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
6132 </tr>
6133 </tbody>
6134 </table>
6135 <p>Generates a constructor that can take in named arguments.</p>
6136 <table class="docutils field-list" frame="void" rules="none">
6137 <col class="field-name" />
6138 <col class="field-body" />
6139 <tbody valign="top">
6140 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
6141 </tr>
6142 </tbody>
6143 </table>
6144 <p>When designing a front-end class template whose back-end is configurable via
6145 parameterized inheritance, it can be useful to omit argument specifiers from
6146 a named-parameter constructor so that the delegate constructors of the
6147 back-end classes can enforce their own specifications.</p>
6148 <pre class="literal-block">
6149 template &lt;typename B&gt;
6150 struct frontend : B
6151 {
6152     BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
6153 };
6154 </pre>
6155 <p>Named parameters are required when invoking the constructor; however, none of
6156 their tags need to be in the same namespace.</p>
6157 <pre class="literal-block">
6158 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a0)
6159 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a1)
6160 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(a2)
6161 </pre>
6162 <p>For this example, each of the back-end class templates requires its own
6163 parameter to be present in the argument pack.  In practice, such parameters
6164 should be optional, with default values.</p>
6165 <pre class="literal-block">
6166 struct _enabler
6167 {
6168 };
6169
6170 template &lt;typename T&gt;
6171 class backend0
6172 {
6173     T a0;
6174
6175  public:
6176     template &lt;typename ArgPack&gt;
6177     explicit backend0(
6178         ArgPack const&amp; args
6179       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
6180             <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a>&lt;ArgPack&gt;
6181           , _enabler
6182         &gt;::type = _enabler()
6183     ) : a0(args[_a0])
6184     {
6185     }
6186
6187     T const&amp; get_a0() const
6188     {
6189         return this-&gt;a0;
6190     }
6191 };
6192
6193 template &lt;typename B, typename T&gt;
6194 class backend1 : public B
6195 {
6196     T a1;
6197
6198  public:
6199     template &lt;typename ArgPack&gt;
6200     explicit backend1(
6201         ArgPack const&amp; args
6202       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
6203             <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a>&lt;ArgPack&gt;
6204           , _enabler
6205         &gt;::type = _enabler()
6206     ) : B(args), a1(args[_a1])
6207     {
6208     }
6209
6210     T const&amp; get_a1() const
6211     {
6212         return this-&gt;a1;
6213     }
6214 };
6215
6216 template &lt;typename B, typename T&gt;
6217 class backend2 : public B
6218 {
6219     T a2;
6220
6221  public:
6222     template &lt;typename ArgPack&gt;
6223     explicit backend2(
6224         ArgPack const&amp; args
6225       , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
6226             <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a>&lt;ArgPack&gt;
6227           , _enabler
6228         &gt;::type = _enabler()
6229     ) : B(args), a2(args[_a2])
6230     {
6231     }
6232
6233     T const&amp; get_a2() const
6234     {
6235         return this-&gt;a2;
6236     }
6237 };
6238 </pre>
6239 <p>This example shows that while <tt class="docutils literal">backend0</tt> must always be the root base class
6240 template and that <tt class="docutils literal">frontend</tt> must always be the most derived class template,
6241 the other back-ends can be chained together in different orders.</p>
6242 <pre class="literal-block">
6243 char const* p = &quot;foo&quot;;
6244 frontend&lt;
6245     backend2&lt;backend1&lt;backend0&lt;char const*&gt;, char&gt;, int&gt;
6246 &gt; composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
6247 frontend&lt;
6248     backend1&lt;backend2&lt;backend0&lt;char const*&gt;, int&gt;, char&gt;
6249 &gt; composed_obj1(_a0 = p, _a1 = ' ', _a2 = 4);
6250 BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
6251 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
6252 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
6253 </pre>
6254 <p>The <a class="reference external" href="../../test/parameterized_inheritance.cpp">parameterized_inheritance.cpp</a> and <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test
6255 programs demonstrate proper usage of this macro.</p>
6256 <p><strong>Macro parameters:</strong></p>
6257 <ul class="simple">
6258 <li><tt class="docutils literal">cls</tt> is the name of the enclosing class.</li>
6259 <li><tt class="docutils literal">impl</tt> is the parenthesized implementation base class for <tt class="docutils literal">cls</tt>.</li>
6260 </ul>
6261 <p><strong>Argument specifiers syntax:</strong></p>
6262 <p>None.</p>
6263 <p><strong>Approximate expansion:</strong></p>
6264 <pre class="literal-block">
6265 template &lt;
6266     typename TaggedArg0
6267   , typename ...TaggedArgs
6268   , typename = typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
6269         <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
6270     &gt;::type
6271 &gt;
6272 inline explicit <strong>cls</strong>(
6273     TaggedArg0 const&amp; arg0
6274   , TaggedArgs const&amp;... args
6275 ) : <strong>impl</strong>(<a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...))
6276 {
6277 }
6278 </pre>
6279 </div>
6280 <div class="section" id="boost-parameter-no-spec-no-base-constructor-cls-impl">
6281 <span id="boost-parameter-no-spec-no-base-constructor"></span><h2><a class="toc-backref" href="#id74">7.18&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(cls, impl)</tt></a></h2>
6282 <table class="docutils field-list" frame="void" rules="none">
6283 <col class="field-name" />
6284 <col class="field-body" />
6285 <tbody valign="top">
6286 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/preprocessor_no_spec.hpp">boost/parameter/preprocessor_no_spec.hpp</a></td>
6287 </tr>
6288 </tbody>
6289 </table>
6290 <p>Generates a constructor that can take in named arguments.</p>
6291 <table class="docutils field-list" frame="void" rules="none">
6292 <col class="field-name" />
6293 <col class="field-body" />
6294 <tbody valign="top">
6295 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
6296 </tr>
6297 </tbody>
6298 </table>
6299 <p>The return type of each of the following function templates falls under a
6300 different value category.</p>
6301 <pre class="literal-block">
6302 template &lt;std::size_t N&gt;
6303 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; rvalue_bitset()
6304 {
6305     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
6306 }
6307
6308 template &lt;std::size_t N&gt;
6309 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const rvalue_const_bitset()
6310 {
6311     return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
6312 }
6313
6314 template &lt;std::size_t N&gt;
6315 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp; lvalue_bitset()
6316 {
6317     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
6318     return lset;
6319 }
6320
6321 template &lt;std::size_t N&gt;
6322 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp; lvalue_const_bitset()
6323 {
6324     static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;();
6325     return clset;
6326 }
6327 </pre>
6328 <p>The <tt class="docutils literal"><span class="pre">U::evaluate_category</span></tt> static member function template has a simple job:
6329 to return the correct value category when passed in an object returned by one
6330 of the functions defined above.  Assume that
6331 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined.</p>
6332 <pre class="literal-block">
6333 enum invoked
6334 {
6335     passed_by_lvalue_reference_to_const
6336   , passed_by_lvalue_reference
6337   , passed_by_rvalue_reference_to_const
6338   , passed_by_rvalue_reference
6339 };
6340
6341 struct U
6342 {
6343     template &lt;std::size_t N&gt;
6344     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;)
6345     {
6346         return passed_by_lvalue_reference_to_const;
6347     }
6348
6349     template &lt;std::size_t N&gt;
6350     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;)
6351     {
6352         return passed_by_lvalue_reference;
6353     }
6354
6355     template &lt;std::size_t N&gt;
6356     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt; const&amp;&amp;)
6357     {
6358         return passed_by_rvalue_reference_to_const;
6359     }
6360
6361     template &lt;std::size_t N&gt;
6362     static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a>&lt;N + 1&gt;&amp;&amp;)
6363     {
6364         return passed_by_rvalue_reference;
6365     }
6366 };
6367 </pre>
6368 <p>Named parameters are required when invoking the constructor; however, none of
6369 their tags need to be in the same namespace.</p>
6370 <pre class="literal-block">
6371 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lrc, kw0) in(lrc))
6372 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_lr, kw1) in_out(lr))
6373 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rrc, kw2) in(rrc))
6374 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>((_rr, kw3) consume(rr))
6375 </pre>
6376 <p>Unlike <a class="reference internal" href="#boost-parameter-no-spec-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR</tt></a>, this macro doesn't require a
6377 base class, only a delegate function to which the generated constructor can
6378 pass its <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>.</p>
6379 <pre class="literal-block">
6380 struct D
6381 {
6382     BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(D, D::_evaluate)
6383
6384  private:
6385     template &lt;typename Args&gt;
6386     static bool _evaluate(Args const&amp; args)
6387     {
6388         BOOST_TEST_EQ(
6389             passed_by_lvalue_reference_to_const
6390           , U::evaluate_category&lt;0&gt;(args[_lrc])
6391         );
6392         BOOST_TEST_EQ(
6393             passed_by_lvalue_reference
6394           , U::evaluate_category&lt;1&gt;(args[_lr])
6395         );
6396         BOOST_TEST_EQ(
6397             passed_by_rvalue_reference_to_const
6398           , U::evaluate_category&lt;2&gt;(
6399                 args[_rrc | rvalue_const_bitset&lt;2&gt;()]
6400             )
6401         );
6402         BOOST_TEST_EQ(
6403             passed_by_rvalue_reference
6404           , U::evaluate_category&lt;3&gt;(
6405                 args[_rr | rvalue_bitset&lt;3&gt;()]
6406             )
6407         );
6408
6409         return true;
6410     }
6411 };
6412 </pre>
6413 <p>To invoke the constructor, bind all its arguments to named parameters.</p>
6414 <pre class="literal-block">
6415 D dp0(
6416     _rr0 = rvalue_bitset&lt;3&gt;()
6417   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
6418   , _lr0 = lvalue_bitset&lt;1&gt;()
6419   , _rrc0 = rvalue_const_bitset&lt;2&gt;()
6420 );
6421 D dp1(
6422     _lr0 = lvalue_bitset&lt;1&gt;()
6423   , _lrc0 = lvalue_const_bitset&lt;0&gt;()
6424 );
6425 </pre>
6426 <p>The <a class="reference external" href="../../test/preprocessor_eval_cat_no_spec.cpp">preprocessor_eval_cat_no_spec.cpp</a> test program demonstrates proper usage of
6427 this macro.</p>
6428 <p><strong>Macro parameters:</strong></p>
6429 <ul class="simple">
6430 <li><tt class="docutils literal">cls</tt> is the name of the enclosing class.</li>
6431 <li><tt class="docutils literal">func</tt> is a function that takes in the <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> that the
6432 generated constructor passes on.</li>
6433 </ul>
6434 <p><strong>Argument specifiers syntax:</strong></p>
6435 <p>None.</p>
6436 <p><strong>Approximate expansion:</strong></p>
6437 <pre class="literal-block">
6438 template &lt;
6439     typename TaggedArg0
6440   , typename ...TaggedArgs
6441   , typename = typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;
6442         <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a>&lt;TaggedArg0,TaggedArgs...&gt;
6443     &gt;::type
6444 &gt;
6445 inline explicit <strong>cls</strong>(
6446     TaggedArg0 const&amp; arg0
6447   , TaggedArgs const&amp;... args
6448 )
6449 {
6450     <strong>func</strong>(<a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...));
6451 }
6452 </pre>
6453 </div>
6454 <div class="section" id="boost-parameter-name-name">
6455 <span id="boost-parameter-name"></span><h2><a class="toc-backref" href="#id75">7.19&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NAME(name)</tt></a></h2>
6456 <table class="docutils field-list" frame="void" rules="none">
6457 <col class="field-name" />
6458 <col class="field-body" />
6459 <tbody valign="top">
6460 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/name.hpp">boost/parameter/name.hpp</a></td>
6461 </tr>
6462 </tbody>
6463 </table>
6464 <p>Declares a tag-type and keyword object.</p>
6465 <p><strong>If</strong> <em>name</em> is of the form:</p>
6466 <pre class="literal-block">
6467 (<em>object-name</em>, <em>namespace-name</em>) <em>qualifier</em>(<em>tag-name</em>)
6468 </pre>
6469 <p><strong>then</strong></p>
6470 <table class="docutils field-list" frame="void" rules="none">
6471 <col class="field-name" />
6472 <col class="field-body" />
6473 <tbody valign="top">
6474 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><em>qualifier</em> is either <tt class="docutils literal">in</tt>, <tt class="docutils literal">out</tt>, <tt class="docutils literal">in_out</tt>, <tt class="docutils literal">consume</tt>,
6475 <tt class="docutils literal">move_from</tt>, or <tt class="docutils literal">forward</tt>.</td>
6476 </tr>
6477 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6478 </tr>
6479 </tbody>
6480 </table>
6481 <pre class="literal-block">
6482 namespace <em>namespace-name</em> {
6483
6484     struct <em>tag-name</em>
6485     {
6486         static constexpr char const* keyword_name()
6487         {
6488             return ## <em>tag-name</em>;
6489         }
6490
6491         typedef <em>unspecified</em> _;
6492         typedef <em>unspecified</em> _1;
6493         typedef boost::parameter::<em>qualifier</em> ## _reference qualifier;
6494
6495         // The following definitions are available only when
6496         // <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined.
6497
6498         template &lt;typename ArgumentPack&gt;
6499         using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;
6500             ArgumentPack
6501           , <em>tag-name</em>
6502         &gt;::type;
6503
6504         template &lt;typename ArgumentPack&gt;
6505         using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;ArgumentPack, <em>tag-name</em>&gt;::type;
6506     };
6507 }
6508
6509 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>tag-namespace</em>::<em>tag-name</em>&gt; const&amp; <em>object-name</em>
6510     = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>tag-namespace</em>::<em>tag-name</em>&gt;::instance;
6511 </pre>
6512 <p><strong>Else If</strong> <em>name</em> is of the form:</p>
6513 <pre class="literal-block">
6514 (<em>tag-name</em>, <em>namespace-name</em>) <em>object-name</em>
6515 </pre>
6516 <p><strong>then</strong></p>
6517 <p>Treats <em>name</em> as if it were of the form:</p>
6518 <pre class="literal-block">
6519 (forward(<em>tag-name</em>), <em>namespace-name</em>) <em>object-name</em>
6520 </pre>
6521 <p><strong>Else If</strong> <em>name</em> is of the form:</p>
6522 <pre class="literal-block">
6523 <em>qualifier</em>(<em>tag-name</em>)
6524 </pre>
6525 <p><strong>then</strong></p>
6526 <table class="docutils field-list" frame="void" rules="none">
6527 <col class="field-name" />
6528 <col class="field-body" />
6529 <tbody valign="top">
6530 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><em>qualifier</em> is either <tt class="docutils literal">in</tt>, <tt class="docutils literal">out</tt>, <tt class="docutils literal">in_out</tt>, <tt class="docutils literal">consume</tt>,
6531 <tt class="docutils literal">move_from</tt>, or <tt class="docutils literal">forward</tt>.</td>
6532 </tr>
6533 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6534 </tr>
6535 </tbody>
6536 </table>
6537 <pre class="literal-block">
6538 namespace tag {
6539
6540     struct <em>tag-name</em>
6541     {
6542         static constexpr char const* keyword_name()
6543         {
6544             return ## <em>tag-name</em>;
6545         }
6546
6547         typedef <em>unspecified</em> _;
6548         typedef <em>unspecified</em> _1;
6549         typedef boost::parameter::<em>qualifier</em> ## _reference qualifier;
6550
6551         // The following definitions are available only when
6552         // <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined.
6553
6554         template &lt;typename ArgumentPack&gt;
6555         using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;
6556             ArgumentPack
6557           , <em>tag-name</em>
6558         &gt;::type;
6559
6560         template &lt;typename ArgumentPack&gt;
6561         using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;ArgumentPack, <em>tag-name</em>&gt;::type;
6562     };
6563 }
6564
6565 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;tag::<em>tag-name</em>&gt; const&amp; _ ## <em>tag-name</em>
6566     = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;tag::<em>tag-name</em>&gt;::instance;
6567 </pre>
6568 <p><strong>Else</strong></p>
6569 <p>Treats <em>name</em> as if it were of the form:</p>
6570 <pre class="literal-block">
6571 forward(<em>tag-name</em>)
6572 </pre>
6573 </div>
6574 <div class="section" id="boost-parameter-nested-keyword-tag-namespace-name-alias">
6575 <span id="boost-parameter-nested-keyword"></span><h2><a class="toc-backref" href="#id76">7.20&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)</tt></a></h2>
6576 <table class="docutils field-list" frame="void" rules="none">
6577 <col class="field-name" />
6578 <col class="field-body" />
6579 <tbody valign="top">
6580 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/nested_keyword.hpp">boost/parameter/nested_keyword.hpp</a></td>
6581 </tr>
6582 </tbody>
6583 </table>
6584 <p>Declares a tag-type, a keyword object, and an alias for that object nested in
6585 the tag-type.</p>
6586 <p><strong>If</strong> <em>name</em> is of the form:</p>
6587 <pre class="literal-block">
6588 <em>qualifier</em>(<em>tag-name</em>)
6589 </pre>
6590 <p><strong>then</strong></p>
6591 <table class="docutils field-list" frame="void" rules="none">
6592 <col class="field-name" />
6593 <col class="field-body" />
6594 <tbody valign="top">
6595 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><em>qualifier</em> is either <tt class="docutils literal">in</tt>, <tt class="docutils literal">out</tt>, <tt class="docutils literal">in_out</tt>, <tt class="docutils literal">consume</tt>,
6596 <tt class="docutils literal">move_from</tt>, or <tt class="docutils literal">forward</tt>.</td>
6597 </tr>
6598 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6599 </tr>
6600 </tbody>
6601 </table>
6602 <pre class="literal-block">
6603 namespace tag {
6604
6605     struct <em>tag-name</em>
6606     {
6607         static constexpr char const* keyword_name()
6608         {
6609             return ## <em>tag-name</em> ## _;
6610         }
6611
6612         typedef <em>unspecified</em> _;
6613         typedef <em>unspecified</em> _1;
6614         typedef boost::parameter::<em>qualifier</em> ## _reference qualifier;
6615         static <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>tag-name</em>&gt; const&amp; <em>alias</em>;
6616
6617         // The following definitions are available only when
6618         // <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined.
6619
6620         template &lt;typename ArgumentPack&gt;
6621         using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;
6622             ArgumentPack
6623           , <em>tag-name</em>
6624         &gt;::type;
6625
6626         template &lt;typename ArgumentPack&gt;
6627         using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;ArgumentPack, <em>tag-name</em>&gt;::type;
6628     };
6629
6630     <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>tag-name</em>&gt; const&amp; tag::<em>tag-name</em>::<em>alias</em>
6631         = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>tag-name</em>&gt;::instance;
6632 }
6633
6634 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;tag::<em>tag-name</em>&gt; const&amp; tag::<em>tag-name</em>::<em>name</em>
6635     = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;tag::<em>tag-name</em>&gt;::instance;
6636 </pre>
6637 <p><strong>Else</strong></p>
6638 <p>Treats <em>name</em> as if it were of the form:</p>
6639 <pre class="literal-block">
6640 forward(<em>tag-name</em>)
6641 </pre>
6642 </div>
6643 <div class="section" id="boost-parameter-template-keyword-name">
6644 <span id="boost-parameter-template-keyword"></span><h2><a class="toc-backref" href="#id77">7.21&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_TEMPLATE_KEYWORD(name)</tt></a></h2>
6645 <table class="docutils field-list" frame="void" rules="none">
6646 <col class="field-name" />
6647 <col class="field-body" />
6648 <tbody valign="top">
6649 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/template_keyword.hpp">boost/parameter/template_keyword.hpp</a></td>
6650 </tr>
6651 <tr class="field"><th class="field-name">Included by:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/name.hpp">boost/parameter/name.hpp</a></td>
6652 </tr>
6653 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6654 </tr>
6655 </tbody>
6656 </table>
6657 <pre class="literal-block">
6658 namespace tag {
6659
6660     struct <em>name</em>;
6661 }
6662
6663 template &lt;typename T&gt;
6664 struct <em>name</em> : <a class="reference internal" href="#template-keyword"><tt class="docutils literal">template_keyword</tt></a>&lt;tag:: <em>name</em>, T&gt;
6665 {
6666 };
6667 </pre>
6668 <p>The <a class="reference external" href="../../test/function_type_tpl_param.cpp">function_type_tpl_param.cpp</a> test program demonstrates proper usage of
6669 this macro.</p>
6670 </div>
6671 <div class="section" id="boost-parameter-fun-r-n-l-h-p">
6672 <span id="boost-parameter-fun"></span><h2><a class="toc-backref" href="#id78">7.22&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_FUN(r, n, l, h, p)</tt></a></h2>
6673 <div class="admonition-deprecated admonition">
6674 <p class="first admonition-title">Deprecated</p>
6675 <p class="last">This macro has been deprecated in favor of
6676 <tt class="docutils literal">BOOST_PARAMETER_FUNCTION</tt>.</p>
6677 </div>
6678 <p>Generates a sequence of <a class="reference external" href="index.html#forwarding-functions">forwarding function</a> templates named
6679 <tt class="docutils literal">n</tt>, with arities ranging from <tt class="docutils literal">l</tt> to <tt class="docutils literal">h</tt>, returning <tt class="docutils literal">r</tt>,
6680 and using <tt class="docutils literal">p</tt> to control overload resolution and assign tags to
6681 positional arguments.</p>
6682 <table class="docutils field-list" frame="void" rules="none">
6683 <col class="field-name" />
6684 <col class="field-body" />
6685 <tbody valign="top">
6686 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/macros.hpp">boost/parameter/macros.hpp</a></td>
6687 </tr>
6688 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">l</tt> and <tt class="docutils literal">h</tt> are nonnegative integer tokens
6689 such that <tt class="docutils literal">l</tt> &lt; <tt class="docutils literal">h</tt></td>
6690 </tr>
6691 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6692 </tr>
6693 </tbody>
6694 </table>
6695 <pre class="literal-block">
6696 template &lt;typename A1, typename A2, …, typename A ## <strong>l</strong>&gt;
6697 r
6698     name(
6699         A1 &amp;&amp; a1, A2 &amp;&amp; a2, …, A ## <strong>l</strong> &amp;&amp; a ## <strong>l</strong>
6700       , typename <strong>p</strong>::match&lt;A1, A2, …, A ## <strong>l</strong>&gt;::type p = <strong>p</strong>()
6701     )
6702 {
6703     return <strong>name</strong>_with_named_params(
6704         <strong>p</strong>(
6705             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A1&gt;(a1)
6706           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A2&gt;(a2)
6707           , …
6708           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>l</strong>&gt;(a ## <strong>l</strong>)
6709         )
6710     );
6711 }
6712
6713 template &lt;
6714     typename A1
6715   , typename A2
6716   , …
6717   , typename A ## <strong>l</strong>
6718   , typename A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6719 &gt;
6720 r
6721     name(
6722         A1 &amp;&amp; a1, A2 &amp;&amp; a2, …, A ## <strong>l</strong> &amp;&amp; a ## <strong>l</strong>
6723       , A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>) const&amp; a ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6724       , typename <strong>p</strong>::match&lt;
6725             A1, A2, …, A ## <strong>l</strong>, A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6726         &gt;::type p = <strong>p</strong>()
6727     )
6728 {
6729     return <strong>name</strong>_with_named_params(
6730         <strong>p</strong>(
6731             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A1&gt;(a1)
6732           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A2&gt;(a2)
6733           , …
6734           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>l</strong>&gt;(a ## <strong>l</strong>)
6735           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)&gt;(
6736                 a ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6737             )
6738         )
6739     );
6740 }
6741
6742 <span class="vellipsis">⋮</span>
6743
6744 template &lt;typename A1, typename A2, …, typename A ## <strong>h</strong>&gt;
6745 r
6746     name(
6747         A1 &amp;&amp; a1, A2 &amp;&amp; a2, …, A ## <strong>h</strong> &amp;&amp; x ## <strong>h</strong>
6748       , typename <strong>p</strong>::match&lt;A1, A2, …, A ## <strong>h</strong>&gt;::type p = <strong>p</strong>()
6749     )
6750 {
6751     return <strong>name</strong>_with_named_params(
6752         <strong>p</strong>(
6753             <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A1&gt;(a1)
6754           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A2&gt;(a2)
6755           , …
6756           , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a>&lt;A ## <strong>h</strong>&gt;(a ## <strong>h</strong>)
6757         )
6758     );
6759 }
6760 </pre>
6761 <p>The <a class="reference external" href="../../test/macros.cpp">macros.cpp</a> and <a class="reference external" href="../../test/macros_eval_category.cpp">macros_eval_category.cpp</a> test programs demonstrate proper
6762 usage of this macro.</p>
6763 </div>
6764 <div class="section" id="boost-parameter-keyword-n-k">
6765 <span id="boost-parameter-keyword"></span><h2><a class="toc-backref" href="#id79">7.23&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_KEYWORD(n, k)</tt></a></h2>
6766 <div class="admonition-deprecated admonition">
6767 <p class="first admonition-title">Deprecated</p>
6768 <p class="last">This macro has been deprecated in favor of
6769 <tt class="docutils literal">BOOST_PARAMETER_NAME</tt>.</p>
6770 </div>
6771 <p>Generates the declaration of a <a class="reference internal" href="#keyword-tag-type">keyword tag type</a> named <tt class="docutils literal">k</tt> in
6772 namespace <tt class="docutils literal">n</tt> and a corresponding <a class="reference internal" href="#keyword-object">keyword object</a> definition in
6773 the enclosing namespace.</p>
6774 <table class="docutils field-list" frame="void" rules="none">
6775 <col class="field-name" />
6776 <col class="field-body" />
6777 <tbody valign="top">
6778 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/keyword.hpp">boost/parameter/keyword.hpp</a></td>
6779 </tr>
6780 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6781 </tr>
6782 </tbody>
6783 </table>
6784 <pre class="literal-block">
6785 namespace <strong>n</strong> {
6786
6787     struct <strong>k</strong>
6788     {
6789         static constexpr char const* keyword_name()
6790         {
6791             return ## <em>k</em>;
6792         }
6793
6794         typedef <em>unspecified</em> _;
6795         typedef <em>unspecified</em> _1;
6796         typedef boost::parameter::forward_reference qualifier;
6797
6798         // The following definitions are available only when
6799         // <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined.
6800
6801         template &lt;typename ArgumentPack&gt;
6802         using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;
6803             ArgumentPack
6804           , <em>k</em>
6805         &gt;::type;
6806
6807         template &lt;typename ArgumentPack&gt;
6808         using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a>&lt;ArgumentPack, <em>k</em>&gt;::type;
6809     };
6810 }
6811
6812 namespace {
6813
6814     <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>n</em>::<strong>k</strong>&gt; const&amp; <strong>k</strong>
6815         = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a>&lt;<em>n</em>::<strong>k</strong>&gt;::instance;
6816 }
6817 </pre>
6818 </div>
6819 <div class="section" id="boost-parameter-match-p-a-x">
6820 <h2><a class="toc-backref" href="#id80">7.24&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MATCH(p, a, x)</tt></a></h2>
6821 <p>Generates a defaulted parameter declaration for a <a class="reference external" href="index.html#forwarding-functions">forwarding function</a>.</p>
6822 <table class="docutils field-list" frame="void" rules="none">
6823 <col class="field-name" />
6824 <col class="field-body" />
6825 <tbody valign="top">
6826 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/match.hpp">boost/parameter/match.hpp</a></td>
6827 </tr>
6828 <tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="docutils literal">a</tt> is a <a class="reference external" href="../../../preprocessor/doc/data.html">Boost.Preprocessor sequence</a> of the form</td>
6829 </tr>
6830 </tbody>
6831 </table>
6832 <pre class="literal-block">
6833 (A0)(A1)…(A ## <em>n</em>)
6834 </pre>
6835 <table class="docutils field-list" frame="void" rules="none">
6836 <col class="field-name" />
6837 <col class="field-body" />
6838 <tbody valign="top">
6839 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6840 </tr>
6841 </tbody>
6842 </table>
6843 <pre class="literal-block">
6844 typename <strong>p</strong>::match&lt;<strong>A0</strong>, <strong>A1</strong>, …, <strong>A</strong> ## <em>n</em>&gt;::type
6845     <strong>x</strong> = <strong>p</strong>()
6846 </pre>
6847 </div>
6848 </div>
6849 <div class="section" id="configuration-macros">
6850 <h1><a class="toc-backref" href="#id81">8&nbsp;&nbsp;&nbsp;Configuration Macros</a></h1>
6851 <div class="section" id="id21">
6852 <span id="boost-parameter-has-perfect-forwarding"></span><h2><a class="toc-backref" href="#id82">8.1&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a></h2>
6853 <p>Determines whether or not the library supports perfect forwarding, or the
6854 preservation of parameter value categories.  Users can manually disable this
6855 macro by <tt class="docutils literal">#defining</tt> the <a class="reference internal" href="#boost-parameter-disable-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING</tt></a>
6856 macro.  Otherwise, the library will <tt class="docutils literal">#define</tt> this macro if and only if it
6857 is not already defined, and if the configuration macros
6858 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects"><tt class="docutils literal">BOOST_NO_FUNCTION_TEMPLATE_ORDERING</tt></a>, <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects"><tt class="docutils literal">BOOST_NO_SFINAE</tt></a>,
6859 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_RVALUE_REFERENCES</tt></a>, <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_VARIADIC_TEMPLATES</tt></a>, and
6860 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS</tt></a> are not already defined by
6861 <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a>.</p>
6862 <table class="docutils field-list" frame="void" rules="none">
6863 <col class="field-name" />
6864 <col class="field-body" />
6865 <tbody valign="top">
6866 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/config.hpp">boost/parameter/config.hpp</a></td>
6867 </tr>
6868 </tbody>
6869 </table>
6870 </div>
6871 <div class="section" id="id22">
6872 <span id="boost-parameter-disable-perfect-forwarding"></span><h2><a class="toc-backref" href="#id83">8.2&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING</tt></a></h2>
6873 <p>It may be necessary to test user code in case perfect forwarding support is
6874 unavailable.  Users can <tt class="docutils literal">#define</tt> this macro either in their project
6875 settings or before including any library header files.  Doing so will leave
6876 both <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
6877 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> undefined.</p>
6878 </div>
6879 <div class="section" id="id23">
6880 <span id="boost-parameter-can-use-mp11"></span><h2><a class="toc-backref" href="#id84">8.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a></h2>
6881 <p>Determines whether or not the library can use <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>, a C++11
6882 metaprogramming library.  Users can manually disable this macro by
6883 <tt class="docutils literal">#defining</tt> the <a class="reference internal" href="#boost-parameter-disable-mp11-usage"><tt class="docutils literal">BOOST_PARAMETER_DISABLE_MP11_USAGE</tt></a> macro or the
6884 <a class="reference internal" href="#boost-parameter-disable-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING</tt></a> macro.  Otherwise, the library
6885 will <tt class="docutils literal">#define</tt> this macro if and only if it is not already defined, if
6886 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is defined, and if the configuration
6887 macros <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_CONSTEXPR</tt></a>, <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_DECLTYPE_N3276</tt></a>,
6888 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_AUTO_DECLARATIONS</tt></a>, <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_TEMPLATE_ALIASES</tt></a>,
6889 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_STATIC_ASSERT</tt></a>, <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_TYPE_TRAITS</tt></a>,
6890 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_INITIALIZER_LIST</tt></a>, and <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_TUPLE</tt></a>
6891 are not already defined by <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a>.</p>
6892 <div class="admonition-usage-note admonition">
6893 <p class="first admonition-title">Usage Note</p>
6894 <p class="last"><a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a> and <a class="reference external" href="../../../mpl/doc/index.html">Boost.MPL</a> are <strong>not</strong> mutually exclusive.  It's
6895 perfectly acceptable to specify deduced parameters using both quoted
6896 metafunctions and metafunction classes, for example.  See
6897 <a class="reference external" href="../../test/evaluate_category.cpp">evaluate_category.cpp</a>.</p>
6898 </div>
6899 <table class="docutils field-list" frame="void" rules="none">
6900 <col class="field-name" />
6901 <col class="field-body" />
6902 <tbody valign="top">
6903 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/config.hpp">boost/parameter/config.hpp</a></td>
6904 </tr>
6905 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
6906 </tr>
6907 </tbody>
6908 </table>
6909 <p>Given the following definitions:</p>
6910 <pre class="literal-block">
6911 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(x)
6912
6913 template &lt;typename A0&gt;
6914 typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a>&lt;<a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_same">std::is_same</a>&lt;int,A0&gt;,int&gt;::type
6915     sfinae(A0 const&amp; a0)
6916 {
6917     return 0;
6918 }
6919 </pre>
6920 <p><a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a> allows deduced parameters to be defined more succinctly:</p>
6921 <pre class="literal-block">
6922 template &lt;typename T, typename Args&gt;
6923 using predicate = <a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_convertible">std::is_convertible</a>&lt;T,char const*&gt;;
6924
6925 <a class="reference internal" href="#boost-parameter-function"><tt class="docutils literal">BOOST_PARAMETER_FUNCTION</tt></a>((int), sfinae, tag,
6926     (deduced
6927         (optional
6928             (x
6929               , *(<a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_quotef">boost::mp11::mp_quote</a>&lt;predicate&gt;)
6930               , static_cast&lt;char const*&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
6931             )
6932         )
6933     )
6934 )
6935 {
6936     return 1;
6937 }
6938 </pre>
6939 <p>Without <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>, deduced parameter definitions tend to be more verbose:</p>
6940 <pre class="literal-block">
6941 struct predicate
6942 {
6943     template &lt;typename T, typename Args&gt;
6944     struct apply
6945       : <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
6946             <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a>&lt;T,char const*&gt;
6947           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a>  // Still have to convert to a
6948           , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean Integral Constant</a>.
6949         &gt;
6950     {
6951     };
6952 };
6953
6954 <a class="reference internal" href="#boost-parameter-function"><tt class="docutils literal">BOOST_PARAMETER_FUNCTION</tt></a>((int), sfinae, tag,
6955     (deduced
6956         (optional
6957             (x
6958               , *(predicate)
6959               , static_cast&lt;char const*&gt;(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
6960             )
6961         )
6962     )
6963 )
6964 {
6965     return 1;
6966 }
6967 </pre>
6968 <p>Either way, the following assertions will succeed:</p>
6969 <pre class="literal-block">
6970 assert(1 == sfinae());
6971 assert(1 == sfinae(&quot;foo&quot;));
6972 assert(0 == sfinae(1));
6973 </pre>
6974 <p>As another example, given the following declarations and definitions:</p>
6975 <pre class="literal-block">
6976 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(x)
6977 <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a>(y)
6978
6979 template &lt;typename E, typename Args&gt;
6980 void check0(E const&amp; e, Args const&amp; args);
6981
6982 template &lt;typename P, typename E, typename ...Args&gt;
6983 void check(E const&amp; e, Args const&amp;... args)
6984 {
6985     check0(e, P()(args...));
6986 }
6987 </pre>
6988 <p>Argument packs qualify as <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>-style lists containing
6989 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a>s:</p>
6990 <pre class="literal-block">
6991 template &lt;typename Args&gt;
6992 struct some_functor
6993 {
6994     template &lt;typename K&gt;
6995     void operator()(K&amp;&amp;) const
6996     {
6997         // K is one of tag::x, tag::y, etc.
6998     }
6999 };
7000
7001 template &lt;typename E, typename Args&gt;
7002 void check0(E const&amp; e, Args const&amp; args)
7003 {
7004     boost::mp11::mp_for_each&lt;E&gt;(some_functor&lt;Args&gt;());
7005 }
7006 </pre>
7007 <p>The first check determines whether or not the argument type of <tt class="docutils literal">_y</tt> is the
7008 same as the reference type of <tt class="docutils literal">_x</tt>, while the second check determines
7009 whether or not the argument type of <tt class="docutils literal">_y</tt> is convertible to the value type of
7010 <tt class="docutils literal">_x</tt>.  Here, it's possible to access the reference and value result types of
7011 indexing an argument pack a little more directly:</p>
7012 <pre class="literal-block">
7013 // Use mp_bind on tag::x::binding_fn to access the reference type of _x.
7014 check&lt;
7015     <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
7016         tag::x
7017       , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a>&lt;
7018             <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a>&lt;tag::y&gt;
7019           , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bindf_t">boost::mp11::mp_bind</a>&lt;
7020                 <a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_same">std::is_same</a> // <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>, standard version.
7021               , <a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a> // will be bound to the argument type of _y.
7022               , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bindf_t">boost::mp11::mp_bind</a>&lt;
7023                     tag::x::binding_fn
7024                   , <a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_2</a> // will be bound to the argument pack type.
7025                 &gt;
7026             &gt;
7027         &gt;
7028     &gt;
7029 &gt;((_x = 0, _y = 1), 0, 1);
7030
7031 // Use mp_bind_q on tag::x to access the value type of _x.
7032 check&lt;
7033     <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
7034         tag::x
7035       , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a>&lt;
7036             <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a>&lt;tag::y&gt;
7037           , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bindf_t">boost::mp11::mp_bind</a>&lt;
7038                 <a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_convertible">std::is_convertible</a> // <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a>, standard version.
7039               , <a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a> // will be bound to the argument type of _y.
7040               , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bind_qq_t">boost::mp11::mp_bind_q</a>&lt;
7041                     tag::x
7042                   , <a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_2</a> // will be bound to the argument pack type.
7043                 &gt;
7044             &gt;
7045         &gt;
7046     &gt;
7047 &gt;((_x = 0U, _y = 1U), 0U, 1U);
7048 </pre>
7049 <p>Argument packs still qualify as <a class="reference external" href="../../../mpl/doc/index.html">Boost.MPL</a>-style lists containing
7050 <a class="reference internal" href="#keyword-tag-type">keyword tag type</a>s:</p>
7051 <pre class="literal-block">
7052 template &lt;typename Args&gt;
7053 struct some_functor
7054 {
7055     template &lt;typename K&gt;
7056     void operator()(K) const
7057     {
7058         // K is one of tag::x, tag::y, etc.
7059     }
7060 };
7061
7062 template &lt;typename E, typename Args&gt;
7063 void check0(E const&amp; e, Args const&amp; args)
7064 {
7065     boost::mpl::for_each&lt;E&gt;(some_functor&lt;Args&gt;());
7066 }
7067 </pre>
7068 <p>However, without <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>, the corresponding checks become a little more
7069 verbose:</p>
7070 <pre class="literal-block">
7071 check&lt;
7072     <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
7073         tag::x
7074       , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a>&lt;
7075             <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a>&lt;tag::y&gt;
7076           , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
7077                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a>&lt;
7078                     <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/add_lvalue_reference.html">boost::add_lvalue_reference</a>&lt;<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a>&gt;
7079                   , <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a>&lt;<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_2</a>, tag::x&gt;
7080                 &gt;
7081               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a>  // Still have to convert to a
7082               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean Integral Constant</a>.
7083             &gt;
7084         &gt;
7085     &gt;
7086 &gt;((_x = 0, _y = 1), 0, 1);
7087
7088 // Use tag::x::_ or tag::x::_1 to access the value type of _x.
7089 check&lt;
7090     <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a>&lt;
7091         tag::x
7092       , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a>&lt;
7093             <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a>&lt;tag::y&gt;
7094           , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a>&lt;
7095                 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a>&lt;<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a>, tag::x::_1&gt;
7096               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a>  // Still have to convert to a
7097               , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // <a class="reference external" href="../../../mpl/doc/refmanual/integral-constant.html">Boolean Integral Constant</a>.
7098             &gt;
7099         &gt;
7100     &gt;
7101 &gt;((_x = 0U, _y = 1U), 0U, 1U);
7102 </pre>
7103 <p>The <a class="reference external" href="../../test/singular.cpp">singular.cpp</a>, <a class="reference external" href="../../test/compose.cpp">compose.cpp</a>, <a class="reference external" href="../../test/optional_deduced_sfinae.cpp">optional_deduced_sfinae.cpp</a>, and
7104 <a class="reference external" href="../../test/deduced_dependent_predicate.cpp">deduced_dependent_predicate.cpp</a> test programs demonstrate proper usage of this
7105 macro.</p>
7106 </div>
7107 <div class="section" id="id24">
7108 <span id="boost-parameter-disable-mp11-usage"></span><h2><a class="toc-backref" href="#id85">8.4&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_DISABLE_MP11_USAGE</tt></a></h2>
7109 <p>It may be necessary to disable usage of <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a> for compilers that
7110 cannot support it.  Users can <tt class="docutils literal">#define</tt> this macro either in their project
7111 settings or before including any library header files.  Doing so will leave
7112 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> undefined.</p>
7113 </div>
7114 <div class="section" id="id25">
7115 <span id="boost-parameter-variadic-mpl-sequence"></span><h2><a class="toc-backref" href="#id86">8.5&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a></h2>
7116 <p>If <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is <tt class="docutils literal">#defined</tt>, then determines
7117 the <a class="reference external" href="../../../mpl/doc/refmanual/variadic-sequence.html">MPL Variadic Sequence</a> underlying the nested <tt class="docutils literal">parameter_spec</tt> type of
7118 <tt class="docutils literal">parameters</tt>.  If the user does not manually <tt class="docutils literal">#define</tt> this macro, then the
7119 library will <tt class="docutils literal">#define</tt> it as <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_listt"><tt class="docutils literal"><span class="pre">boost::mp11::mp_list</span></tt></a> if
7120 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> is defined, <a class="reference external" href="../../../fusion/doc/html/fusion/container/list.html"><tt class="docutils literal"><span class="pre">boost::fusion::list</span></tt></a> if
7121 <a class="reference external" href="../../../../boost/fusion/container/list/list_fwd.hpp"><tt class="docutils literal">BOOST_FUSION_HAS_VARIADIC_LIST</tt></a> is defined (by <a class="reference external" href="../../../fusion/doc/html/index.html">Boost.Fusion</a>),
7122 <a class="reference external" href="../../../fusion/doc/html/fusion/container/deque.html"><tt class="docutils literal"><span class="pre">boost::fusion::deque</span></tt></a> if <a class="reference external" href="../../../../boost/fusion/container/deque/deque_fwd.hpp"><tt class="docutils literal">BOOST_FUSION_HAS_VARIADIC_DEQUE</tt></a> is defined
7123 (by <a class="reference external" href="../../../fusion/doc/html/index.html">Boost.Fusion</a>), or <a class="reference external" href="../../../mpl/doc/refmanual/vector.html"><tt class="docutils literal"><span class="pre">boost::mpl::vector</span></tt></a> otherwise.</p>
7124 <table class="docutils field-list" frame="void" rules="none">
7125 <col class="field-name" />
7126 <col class="field-body" />
7127 <tbody valign="top">
7128 <tr class="field"><th class="field-name">Example:</th><td class="field-body"></td>
7129 </tr>
7130 </tbody>
7131 </table>
7132 <pre class="literal-block">
7133 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE <a class="reference external" href="../../../fusion/doc/html/fusion/container/vector.html"><tt class="docutils literal"><span class="pre">boost::fusion::vector</span></tt></a>
7134 </pre>
7135 <table class="docutils field-list" frame="void" rules="none">
7136 <col class="field-name" />
7137 <col class="field-body" />
7138 <tbody valign="top">
7139 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/parameters.hpp">boost/parameter/parameters.hpp</a></td>
7140 </tr>
7141 </tbody>
7142 </table>
7143 </div>
7144 <div class="section" id="id26">
7145 <span id="boost-parameter-max-arity"></span><h2><a class="toc-backref" href="#id87">8.6&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_MAX_ARITY</tt></a></h2>
7146 <p>If <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is <tt class="docutils literal">#defined</tt>, then:</p>
7147 <ul class="simple">
7148 <li>If the <a class="reference external" href="../../../mpl/doc/refmanual/variadic-sequence.html">MPL Variadic Sequence</a> underlying the nested <tt class="docutils literal">parameter_spec</tt>
7149 type of <tt class="docutils literal">parameters</tt> does not have a size limit--which is the case with
7150 <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_listt"><tt class="docutils literal"><span class="pre">boost::mp11::mp_list</span></tt></a>, <a class="reference external" href="../../../fusion/doc/html/fusion/container/list.html"><tt class="docutils literal"><span class="pre">boost::fusion::list</span></tt></a>, and <a class="reference external" href="../../../fusion/doc/html/fusion/container/deque.html"><tt class="docutils literal"><span class="pre">boost::fusion::deque</span></tt></a>, but not
7151 <a class="reference external" href="../../../mpl/doc/refmanual/vector.html"><tt class="docutils literal"><span class="pre">boost::mpl::vector</span></tt></a>--then this macro can be safely ignored.  User code that
7152 manually defines <a class="reference internal" href="#boost-parameter-variadic-mpl-sequence"><tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a> should also
7153 manually define this macro to the size limit of the sequence if it has
7154 one.</li>
7155 </ul>
7156 <p>If <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is <strong>not</strong> <tt class="docutils literal">#defined</tt>, then:</p>
7157 <ul class="simple">
7158 <li>Mutable references must be wrapped by <a class="reference external" href="../../../core/doc/html/core/ref.html"><tt class="docutils literal"><span class="pre">boost::ref</span></tt></a> or <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/functional/ref"><tt class="docutils literal"><span class="pre">std::ref</span></tt></a> if passed
7159 by position to Boost.Parameter-enabled functions with arity greater than
7160 or equal to <a class="reference internal" href="#boost-parameter-exponential-overload-threshold-arity"><tt class="docutils literal">BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY</tt></a>.</li>
7161 </ul>
7162 <table class="docutils field-list" frame="void" rules="none">
7163 <col class="field-name" />
7164 <col class="field-body" />
7165 <tbody valign="top">
7166 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/config.hpp">boost/parameter/config.hpp</a></td>
7167 </tr>
7168 <tr class="field"><th class="field-name">Default Value:</th><td class="field-body"><a class="reference external" href="../../../mpl/doc/refmanual/limit-vector-size.html"><tt class="docutils literal">BOOST_MPL_LIMIT_VECTOR_SIZE</tt></a> (defined by <a class="reference external" href="../../../mpl/doc/index.html">Boost.MPL</a>) if
7169 perfect forwarding is supported, <tt class="docutils literal">8</tt> otherwise.</td>
7170 </tr>
7171 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">2</tt></td>
7172 </tr>
7173 <tr class="field"><th class="field-name">Maximum Value:</th><td class="field-body"><a class="reference internal" href="#boost-parameter-compose-max-arity"><tt class="docutils literal">BOOST_PARAMETER_COMPOSE_MAX_ARITY</tt></a></td>
7174 </tr>
7175 </tbody>
7176 </table>
7177 </div>
7178 <div class="section" id="id27">
7179 <span id="boost-parameter-compose-max-arity"></span><h2><a class="toc-backref" href="#id88">8.7&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_COMPOSE_MAX_ARITY</tt></a></h2>
7180 <p>If <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is <strong>not</strong> <tt class="docutils literal">#defined</tt>, then
7181 determines the maximum number of arguments supported by the <tt class="docutils literal">compose</tt> function
7182 and by the <a class="reference internal" href="#boost-parameter-no-spec-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION</tt></a>,
7183 <a class="reference internal" href="#boost-parameter-no-spec-member-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION</tt></a>,
7184 <a class="reference internal" href="#boost-parameter-no-spec-const-member-function"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION</tt></a>,
7185 <a class="reference internal" href="#boost-parameter-no-spec-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR</tt></a>,
7186 <a class="reference internal" href="#boost-parameter-no-spec-const-function-call-operator"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR</tt></a>,
7187 <a class="reference internal" href="#boost-parameter-no-spec-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR</tt></a>, and
7188 <a class="reference internal" href="#boost-parameter-no-spec-no-base-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR</tt></a> code generation macros.</p>
7189 <table class="docutils field-list" frame="void" rules="none">
7190 <col class="field-name" />
7191 <col class="field-body" />
7192 <tbody valign="top">
7193 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/config.hpp">boost/parameter/config.hpp</a></td>
7194 </tr>
7195 <tr class="field"><th class="field-name">Default Value:</th><td class="field-body"><tt class="docutils literal">20</tt> for a few older compilers, <tt class="docutils literal">64</tt> otherwise</td>
7196 </tr>
7197 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">2</tt></td>
7198 </tr>
7199 </tbody>
7200 </table>
7201 </div>
7202 <div class="section" id="id28">
7203 <span id="boost-parameter-exponential-overload-threshold-arity"></span><h2><a class="toc-backref" href="#id89">8.8&nbsp;&nbsp;&nbsp;<tt class="docutils literal">BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY</tt></a></h2>
7204 <p>If this library does <strong>not</strong> support perfect forwarding, determines the number
7205 of arguments less than which <tt class="docutils literal">parameters</tt> generates an exponential number of
7206 function call operator overloads, and greater than or equal to which
7207 <tt class="docutils literal">parameters</tt> does not.  Will only be <tt class="docutils literal">#defined</tt> by the library if it is
7208 not already <tt class="docutils literal">#defined</tt> and <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> is
7209 <strong>not</strong> <tt class="docutils literal">#defined</tt>.</p>
7210 <table class="docutils field-list" frame="void" rules="none">
7211 <col class="field-name" />
7212 <col class="field-body" />
7213 <tbody valign="top">
7214 <tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/config.hpp">boost/parameter/config.hpp</a></td>
7215 </tr>
7216 <tr class="field"><th class="field-name">Default Value:</th><td class="field-body"><tt class="docutils literal">0</tt></td>
7217 </tr>
7218 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">0</tt></td>
7219 </tr>
7220 </tbody>
7221 </table>
7222 </div>
7223 <div class="section" id="outside-of-this-library">
7224 <h2><a class="toc-backref" href="#id90">8.9&nbsp;&nbsp;&nbsp;...Outside Of This Library</a></h2>
7225 <ol class="arabic simple">
7226 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro
7227 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects"><tt class="docutils literal">BOOST_NO_FUNCTION_TEMPLATE_ORDERING</tt></a>, then the macros
7228 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
7229 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined; otherwise, the
7230 code generation macros would not work correctly.</li>
7231 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__03_defects"><tt class="docutils literal">BOOST_NO_SFINAE</tt></a>, then the macros
7232 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
7233 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined; otherwise, keyword
7234 types generated by <a class="reference internal" href="#boost-parameter-name"><tt class="docutils literal">BOOST_PARAMETER_NAME</tt></a> and
7235 <a class="reference internal" href="#boost-parameter-nested-keyword"><tt class="docutils literal">BOOST_PARAMETER_NESTED_KEYWORD</tt></a> would not work correctly.</li>
7236 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro
7237 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_RVALUE_REFERENCES</tt></a>, then the macros
7238 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
7239 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7240 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_VARIADIC_TEMPLATES</tt></a>,
7241 then the macros <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
7242 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7243 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro
7244 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS</tt></a>, then the macros
7245 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a> and
7246 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7247 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_CONSTEXPR</tt></a>, then the
7248 macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7249 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_DECLTYPE_N3276</tt></a>,
7250 then the macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7251 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_AUTO_DECLARATIONS</tt></a>,
7252 then the macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7253 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_TEMPLATE_ALIASES</tt></a>,
7254 then the macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7255 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_STATIC_ASSERT</tt></a>, then
7256 the macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7257 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_TYPE_TRAITS</tt></a>,
7258 then the macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7259 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro
7260 <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_INITIALIZER_LIST</tt></a>, then the macro
7261 <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7262 <li>If <a class="reference external" href="../../../config/doc/html/index.html">Boost.Config</a> defines the macro <a class="reference external" href="../../../config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported"><tt class="docutils literal">BOOST_NO_CXX11_HDR_TUPLE</tt></a>, then the
7263 macro <a class="reference internal" href="#boost-parameter-can-use-mp11"><tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a> will be left undefined.</li>
7264 <li>If <a class="reference external" href="../../../fusion/doc/html/index.html">Boost.Fusion</a> defines the macro <a class="reference external" href="../../../../boost/fusion/container/list/list_fwd.hpp"><tt class="docutils literal">BOOST_FUSION_HAS_VARIADIC_LIST</tt></a>,
7265 if this library defines the macro
7266 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a>, and if
7267 <a class="reference internal" href="#boost-parameter-variadic-mpl-sequence"><tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a> is left undefined, then the
7268 <a class="reference external" href="../../../mpl/doc/refmanual/variadic-sequence.html">MPL Variadic Sequence</a> underlying the nested <tt class="docutils literal">parameter_spec</tt> type of
7269 <tt class="docutils literal">parameters</tt> will be <a class="reference external" href="../../../fusion/doc/html/fusion/container/list.html"><tt class="docutils literal"><span class="pre">boost::fusion::list</span></tt></a>.</li>
7270 <li>If <a class="reference external" href="../../../fusion/doc/html/index.html">Boost.Fusion</a> defines the macro <a class="reference external" href="../../../../boost/fusion/container/deque/deque_fwd.hpp"><tt class="docutils literal">BOOST_FUSION_HAS_VARIADIC_DEQUE</tt></a>,
7271 if this library defines the macro
7272 <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a>, and if
7273 <a class="reference internal" href="#boost-parameter-variadic-mpl-sequence"><tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a> is left undefined, then the
7274 <a class="reference external" href="../../../mpl/doc/refmanual/variadic-sequence.html">MPL Variadic Sequence</a> underlying the nested <tt class="docutils literal">parameter_spec</tt> type of
7275 <tt class="docutils literal">parameters</tt> will be <a class="reference external" href="../../../fusion/doc/html/fusion/container/deque.html"><tt class="docutils literal"><span class="pre">boost::fusion::deque</span></tt></a>.</li>
7276 <li>The value that <a class="reference external" href="../../../mpl/doc/index.html">Boost.MPL</a> defines the macro
7277 <a class="reference external" href="../../../mpl/doc/refmanual/limit-vector-size.html"><tt class="docutils literal">BOOST_MPL_LIMIT_VECTOR_SIZE</tt></a> as will be the value that this library
7278 defines the macro <a class="reference internal" href="#boost-parameter-max-arity"><tt class="docutils literal">BOOST_PARAMETER_MAX_ARITY</tt></a> as if this library defines
7279 the macro <a class="reference internal" href="#boost-parameter-has-perfect-forwarding"><tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a>.</li>
7280 </ol>
7281 </div>
7282 </div>
7283 <div class="section" id="tutorial">
7284 <h1><a class="toc-backref" href="#id91">9&nbsp;&nbsp;&nbsp;Tutorial</a></h1>
7285 <p>Follow <a class="reference external" href="index.html#tutorial">this link</a> to the Boost.Parameter tutorial documentation.</p>
7286 <hr class="docutils" />
7287 <table class="docutils footnote" frame="void" id="thread" rules="none">
7288 <colgroup><col class="label" /><col /></colgroup>
7289 <tbody valign="top">
7290 <tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td>References to tag objects may be initialized multiple
7291 times.  This scenario can only occur in the presence of
7292 threading.  Because the C++ standard doesn't consider threading,
7293 it doesn't explicitly allow or forbid multiple initialization of
7294 references.  That said, it's hard to imagine an implementation
7295 where it could make a difference.</td></tr>
7296 </tbody>
7297 </table>
7298 <table class="docutils footnote" frame="void" id="no-result-of" rules="none">
7299 <colgroup><col class="label" /><col /></colgroup>
7300 <tbody valign="top">
7301 <tr><td class="label">[2]</td><td><em>(<a class="fn-backref" href="#id6">1</a>, <a class="fn-backref" href="#id12">2</a>, <a class="fn-backref" href="#id15">3</a>)</em> Where <a class="reference external" href="../../../utility/utility.htm#BOOST_NO_RESULT_OF"><tt class="docutils literal">BOOST_NO_RESULT_OF</tt></a> is <tt class="docutils literal">#defined</tt>,
7302 <a class="reference external" href="../../../utility/utility.htm#result_of"><tt class="docutils literal"><span class="pre">boost::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>
7303 </tbody>
7304 </table>
7305 </div>
7306 </div>
7307 <div class="footer">
7308 <hr class="footer" />
7309 Generated on: 2019-12-10 00:22 UTC.
7310 Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
7311
7312 </div>
7313 </body>
7314 </html>