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">
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" />
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" />
21 <tr><th class="docinfo-name">Authors:</th>
23 <br />Daniel Wallin</td></tr>
24 <tr><th class="docinfo-name">Contact:</th>
25 <td><a class="first reference external" href="mailto:dave@boost-consulting.com">dave@boost-consulting.com</a>, <a class="last reference external" href="mailto:daniel@boostpro.com">daniel@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>
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 Preliminaries</a><ul class="auto-toc">
43 <li><a class="reference internal" href="#namespaces" id="id32">1.1 Namespaces</a></li>
44 <li><a class="reference internal" href="#exceptions" id="id33">1.2 Exceptions</a></li>
45 <li><a class="reference internal" href="#thread-safety" id="id34">1.3 Thread Safety</a></li>
46 <li><a class="reference internal" href="#typography" id="id35">1.4 Typography</a></li>
49 <li><a class="reference internal" href="#terminology" id="id36">2 Terminology</a></li>
50 <li><a class="reference internal" href="#concepts" id="id37">3 Concepts</a><ul class="auto-toc">
51 <li><a class="reference internal" href="#argumentpack" id="id38">3.1 <span class="concept">ArgumentPack</span></a></li>
52 <li><a class="reference internal" href="#id3" id="id39">3.2 <span class="concept">ParameterSpec</span></a></li>
55 <li><a class="reference internal" href="#class-templates" id="id40">4 Class Templates</a><ul class="auto-toc">
56 <li><a class="reference internal" href="#id5" id="id41">4.1 <tt class="docutils literal">keyword</tt></a></li>
57 <li><a class="reference internal" href="#id7" id="id42">4.2 <tt class="docutils literal">template_keyword</tt></a></li>
58 <li><a class="reference internal" href="#id8" id="id43">4.3 <tt class="docutils literal">parameters</tt></a></li>
59 <li><a class="reference internal" href="#optional-required" id="id44">4.4 <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 <tt class="docutils literal">deduced</tt></a></li>
63 <li><a class="reference internal" href="#metafunctions" id="id46">5 Metafunctions</a><ul class="auto-toc">
64 <li><a class="reference internal" href="#id10" id="id47">5.1 <tt class="docutils literal">binding</tt></a></li>
65 <li><a class="reference internal" href="#id11" id="id48">5.2 <tt class="docutils literal">lazy_binding</tt></a></li>
66 <li><a class="reference internal" href="#id13" id="id49">5.3 <tt class="docutils literal">value_type</tt></a></li>
67 <li><a class="reference internal" href="#id14" id="id50">5.4 <tt class="docutils literal">lazy_value_type</tt></a></li>
68 <li><a class="reference internal" href="#id16" id="id51">5.5 <tt class="docutils literal">are_tagged_arguments</tt></a></li>
69 <li><a class="reference internal" href="#id17" id="id52">5.6 <tt class="docutils literal">is_argument_pack</tt></a></li>
70 <li><a class="reference internal" href="#id18" id="id53">5.7 <tt class="docutils literal"><span class="pre">result_of::compose</span></tt></a></li>
73 <li><a class="reference internal" href="#function-templates" id="id54">6 Function Templates</a><ul class="auto-toc">
74 <li><a class="reference internal" href="#id19" id="id55">6.1 <tt class="docutils literal">compose</tt></a></li>
77 <li><a class="reference internal" href="#code-generation-macros" id="id56">7 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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <tt class="docutils literal">BOOST_PARAMETER_MATCH(p, a, x)</tt></a></li>
104 <li><a class="reference internal" href="#configuration-macros" id="id81">8 Configuration Macros</a><ul class="auto-toc">
105 <li><a class="reference internal" href="#id21" id="id82">8.1 <tt class="docutils literal">BOOST_PARAMETER_HAS_PERFECT_FORWARDING</tt></a></li>
106 <li><a class="reference internal" href="#id22" id="id83">8.2 <tt class="docutils literal">BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING</tt></a></li>
107 <li><a class="reference internal" href="#id23" id="id84">8.3 <tt class="docutils literal">BOOST_PARAMETER_CAN_USE_MP11</tt></a></li>
108 <li><a class="reference internal" href="#id24" id="id85">8.4 <tt class="docutils literal">BOOST_PARAMETER_DISABLE_MP11_USAGE</tt></a></li>
109 <li><a class="reference internal" href="#id25" id="id86">8.5 <tt class="docutils literal">BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE</tt></a></li>
110 <li><a class="reference internal" href="#id26" id="id87">8.6 <tt class="docutils literal">BOOST_PARAMETER_MAX_ARITY</tt></a></li>
111 <li><a class="reference internal" href="#id27" id="id88">8.7 <tt class="docutils literal">BOOST_PARAMETER_COMPOSE_MAX_ARITY</tt></a></li>
112 <li><a class="reference internal" href="#id28" id="id89">8.8 <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 ...Outside Of This Library</a></li>
116 <li><a class="reference internal" href="#tutorial" id="id91">9 Tutorial</a></li>
119 <hr class="docutils" />
120 <div class="section" id="preliminaries">
121 <h1><a class="toc-backref" href="#id31">1 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 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>
129 <div class="section" id="exceptions">
130 <h2><a class="toc-backref" href="#id33">1.2 Exceptions</a></h2>
131 <p>No operation described in this document throws an exception unless otherwise
134 <div class="section" id="thread-safety">
135 <h2><a class="toc-backref" href="#id34">1.3 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>
139 <div class="section" id="typography">
140 <h2><a class="toc-backref" href="#id35">1.4 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>
149 <hr class="docutils" />
150 <div class="section" id="terminology">
151 <h1><a class="toc-backref" href="#id36">2 Terminology</a></h1>
152 <dl class="docutils" id="kw">
154 <dd>The name of a function parameter.</dd>
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>
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>
166 <span class="target" id="tag-type"></span><dl class="docutils">
168 <dd>Shorthand for “<a class="reference internal" href="#keyword-tag-type">keyword tag type</a>.”</dd>
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"><T></tt> for some <a class="reference internal" href="#tag-type">tag type</a> <tt class="docutils literal">T</tt>.</dd>
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>
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>
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>
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>
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>
206 <hr class="docutils" />
207 <div class="section" id="concepts">
208 <h1><a class="toc-backref" href="#id37">3 Concepts</a></h1>
209 <p>This section describes the generic type concepts used by the Parameter
211 <div class="section" id="argumentpack">
212 <h2><a class="toc-backref" href="#id38">3.1 <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>
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"><…>::operator=</span></tt>)</li>
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>
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>
248 <tr><td><tt class="docutils literal">x[u]</tt></td>
249 <td><tt class="docutils literal">binding<A, <span class="pre">K>::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
258 <tr><td><tt class="docutils literal">x[u]</tt></td>
259 <td><tt class="docutils literal">binding<A, L, <span class="pre">D>::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
268 <tt class="docutils literal">u</tt>'s <em>value</em>.</td>
270 <tr><td><tt class="docutils literal">x[w]</tt></td>
271 <td><tt class="docutils literal">lazy_binding<A, M, <span class="pre">E>::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
280 <tt class="docutils literal">w</tt>'s <em>value</em>
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>
288 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
291 <tt class="docutils literal">x</tt> and <tt class="docutils literal">z</tt>.</td>
297 <div class="section" id="id3">
298 <span id="parameterspec"></span><h2><a class="toc-backref" href="#id39">3.2 <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>
309 <table border="1" class="docutils">
310 <caption><span class="concept">ParameterSpec</span> allowed forms and conditions of satisfaction</caption>
316 <thead valign="bottom">
317 <tr><th class="head">Type</th>
318 <th class="head"><tt class="docutils literal">A</tt>
320 <th class="head">Condition <tt class="docutils literal">A</tt> must satisfy</th>
324 <tr><td><tt class="docutils literal">K</tt></td>
326 <td><em>n/a</em></td>
328 <tr><td><a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><tt class="docutils literal"><K,F></tt></td>
330 <td><tt class="docutils literal"><span class="pre">mpl::apply2<F,A,P>::type::value</span></tt> is
331 <tt class="docutils literal">true</tt>.</td>
333 <tr><td><a class="reference internal" href="#required"><tt class="docutils literal">required</tt></a><tt class="docutils literal"><K,F></tt></td>
335 <td><tt class="docutils literal"><span class="pre">mpl::apply2<F,A,P>::type::value</span></tt> is
336 <tt class="docutils literal">true</tt>.</td>
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>
344 <hr class="docutils" />
345 <div class="section" id="class-templates">
346 <h1><a class="toc-backref" href="#id40">4 Class Templates</a></h1>
347 <div class="section" id="id5">
348 <span id="keyword"></span><h2><a class="toc-backref" href="#id41">4.1 <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" />
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>
358 <pre class="literal-block">
359 template <typename Tag>
364 template <typename T>
365 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
366 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
367 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
370 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
371 typename Tag::qualifier
372 , boost::parameter::in_reference
374 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "in" references.
375 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
376 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
377 typename Tag::qualifier
378 , boost::parameter::forward_reference
380 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
381 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
385 , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
387 <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T const& value) const;
389 template <typename T>
390 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
391 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
392 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
393 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
394 typename Tag::qualifier
395 , boost::parameter::out_reference
397 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is "out".
398 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
399 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
400 typename Tag::qualifier
401 , boost::parameter::forward_reference
403 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is "forward".
404 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // The reference category is neither "out" nor "forward".
407 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
408 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_const.html">boost::is_const</a><T>
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.
412 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for references neither "out" nor "forward".
414 , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
416 <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T& value) const;
418 template <typename T>
419 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
420 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
421 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
424 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
425 typename Tag::qualifier
426 , boost::parameter::in_reference
428 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "in" references.
429 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
430 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
431 typename Tag::qualifier
432 , boost::parameter::forward_reference
434 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
435 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
439 , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
441 <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T const&& value) const;
443 template <typename T>
444 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
445 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
446 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
449 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
450 typename Tag::qualifier
451 , boost::parameter::consume_reference
453 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "consume" references.
454 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
455 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
456 typename Tag::qualifier
457 , boost::parameter::forward_reference
459 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
460 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
464 , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
466 <a class="reference internal" href="#assignment-operator"><tt class="docutils literal">operator=</tt></a>(T&& value) const;
468 template <typename T>
469 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
470 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
471 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
474 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
475 typename Tag::qualifier
476 , boost::parameter::in_reference
478 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "in" references.
479 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
480 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
481 typename Tag::qualifier
482 , boost::parameter::forward_reference
484 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
485 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
489 , <em>tagged default</em>
491 <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T const& x) const;
493 template <typename T>
494 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
495 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
496 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
497 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
498 typename Tag::qualifier
499 , boost::parameter::out_reference
501 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is "out".
502 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
503 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
504 typename Tag::qualifier
505 , boost::parameter::forward_reference
507 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // The reference category is "forward".
508 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // The reference category is neither "out" nor "forward".
511 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
512 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_const.html">boost::is_const</a><T>
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.
516 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for references neither "out" nor "forward".
518 , <em>tagged default</em>
520 <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T& x) const;
522 template <typename T>
523 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
524 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
525 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
528 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
529 typename Tag::qualifier
530 , boost::parameter::in_reference
532 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "in" references.
533 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
534 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
535 typename Tag::qualifier
536 , boost::parameter::forward_reference
538 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
539 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
543 , <em>tagged default</em>
545 <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T const&& x) const;
547 template <typename T>
548 constexpr typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
549 typename <a class="reference external" href="../../../mpl/doc/refmanual/eval-if.html">boost::mpl::eval_if</a><
550 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_scalar.html">boost::is_scalar</a><T>
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><
553 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
554 typename Tag::qualifier
555 , boost::parameter::consume_reference
557 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "consume" references.
558 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
559 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
560 typename Tag::qualifier
561 , boost::parameter::forward_reference
563 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::true_</a> // Enable this overload for "forward" references.
564 , <a class="reference external" href="../../../mpl/doc/refmanual/bool.html">mpl::false_</a> // Disable this overload for all other reference categories.
568 , <em>tagged default</em>
570 <a class="reference internal" href="#bitwise-or-operator"><tt class="docutils literal">operator|</tt></a>(T&& value) const;
572 template <typename F>
573 constexpr <em>tagged lazy default</em> <a class="reference internal" href="#logical-or-operator"><tt class="docutils literal">operator||</tt></a>(F const&) const;
575 template <typename F>
576 constexpr <em>tagged lazy default</em> <a class="reference internal" href="#logical-or-operator"><tt class="docutils literal">operator||</tt></a>(F&) const;
578 static keyword<Tag> const& instance;
580 static keyword<Tag>& <a class="reference internal" href="#get">get</a>();
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" />
588 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
592 <pre class="literal-block">
593 template <typename T>
594 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T const& value) const;
596 template <typename T>
597 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T& value) const;
599 template <typename T>
600 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T const&& value) const;
602 template <typename T>
603 constexpr <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator=(T&& value) const;
605 <table class="docutils field-list" frame="void" rules="none">
606 <col class="field-name" />
607 <col class="field-body" />
609 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">one of the following:</td>
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>
626 <table class="docutils field-list" frame="void" rules="none">
627 <col class="field-name" />
628 <col class="field-body" />
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>
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" />
640 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
644 <pre class="literal-block">
645 template <typename T>
646 constexpr <em>tagged default</em> operator|(T const& x) const;
648 template <typename T>
649 constexpr <em>tagged default</em> operator|(T& x) const;
651 template <typename T>
652 constexpr <em>tagged default</em> operator|(T const&& x) const;
654 template <typename T>
655 constexpr <em>tagged default</em> operator|(T&& x) const;
657 <table class="docutils field-list" frame="void" rules="none">
658 <col class="field-name" />
659 <col class="field-body" />
661 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">one of the following:</td>
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>
678 <table class="docutils field-list" frame="void" rules="none">
679 <col class="field-name" />
680 <col class="field-body" />
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>
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" />
691 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
695 <pre class="literal-block">
696 template <typename F>
697 constexpr <em>tagged lazy default</em> operator||(F const& g) const;
699 template <typename F>
700 constexpr <em>tagged lazy default</em> operator||(F& g) const;
702 <table class="docutils field-list" frame="void" rules="none">
703 <col class="field-name" />
704 <col class="field-body" />
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"><F()>::type</span></tt>.<a class="footnote-reference" href="#no-result-of" id="id6"><sup>2</sup></a></td>
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>
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" />
718 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
722 <pre class="literal-block">
723 static keyword<Tag> const& instance;
725 <table class="docutils field-list" frame="void" rules="none">
726 <col class="field-name" />
727 <col class="field-body" />
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>
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>
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" />
741 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
745 <pre class="literal-block">
746 static keyword<Tag>& get();
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>
752 <table class="docutils field-list" frame="void" rules="none">
753 <col class="field-name" />
754 <col class="field-body" />
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>
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>
764 <div class="section" id="id7">
765 <span id="template-keyword"></span><h2><a class="toc-backref" href="#id42">4.2 <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" />
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>
777 <pre class="literal-block">
778 template <typename Tag, typename T>
779 struct template_keyword
781 typedef Tag key_type;
782 typedef T value_type;
783 typedef <em>implementation defined</em> reference;
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>
788 <div class="section" id="id8">
789 <span id="parameters"></span><h2><a class="toc-backref" href="#id43">4.3 <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" />
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>
801 <pre class="literal-block">
802 template <typename ...PSpec>
805 template <typename ...Args>
806 struct <a class="reference internal" href="#match"><tt class="docutils literal">match</tt></a>
811 template <typename ...Args>
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&&... args) const;
815 <table class="docutils field-list" frame="void" rules="none">
816 <col class="field-name" />
817 <col class="field-body" />
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>
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<T>::</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>
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<T>::</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>
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>
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
865 <table class="docutils field-list" frame="void" rules="none">
866 <col class="field-name" />
867 <col class="field-body" />
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<Params...></span></tt>. Otherwise, <tt class="docutils literal"><span class="pre">match<Args...>::type</span></tt> is not
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>
877 <li><p class="first"><tt class="docutils literal">P</tt> is the <em>unspecified</em> default</p>
879 <li><p class="first"><strong>or</strong>, <tt class="docutils literal">P</tt> is a <em>keyword tag type</em></p>
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"><X,F></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>
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<F,R</span></tt> ## <em>i</em></dt>
888 <dd><p class="first last"><tt class="docutils literal"><span class="pre">>::type::value</span></tt> is <tt class="docutils literal">true</tt></p>
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"><X,F></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<F,R</span></tt> ## <em>i</em> <tt class="docutils literal"><span class="pre">>::type::value</span></tt> is <tt class="docutils literal">true</tt></li>
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" />
911 <tr class="field"><th class="field-name">Synopsis:</th><td class="field-body"></td>
915 <pre class="literal-block">
916 template <typename ...Args>
917 <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> operator()(Args&&... args) const;
919 <table class="docutils field-list" frame="void" rules="none">
920 <col class="field-name" />
921 <col class="field-body" />
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>
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>
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>
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 <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" />
949 <tr class="field"><th class="field-name" colspan="2">Specializations model:</th></tr>
950 <tr class="field"><td> </td><td class="field-body"><a class="reference internal" href="#parameterspec"><span class="concept">ParameterSpec</span></a></td>
954 <pre class="literal-block">
955 template <typename Tag, typename Predicate = <em>unspecified</em>>
958 template <typename Tag, typename Predicate = <em>unspecified</em>>
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>
967 <div class="section" id="id9">
968 <span id="deduced"></span><h2><a class="toc-backref" href="#id45">4.5 <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" />
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>
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>
981 <pre class="literal-block">
982 template <typename Tag>
985 <table class="docutils field-list" frame="void" rules="none">
986 <col class="field-name" />
987 <col class="field-body" />
989 <tr class="field"><th class="field-name">Requires:</th><td class="field-body">nothing</td>
995 <hr class="docutils" />
996 <div class="section" id="metafunctions">
997 <h1><a class="toc-backref" href="#id46">5 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,
1000 <div class="section" id="id10">
1001 <span id="binding"></span><h2><a class="toc-backref" href="#id47">5.1 <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>
1012 <pre class="literal-block">
1013 template <typename A, typename K, typename D = void_>
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>
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>
1032 <div class="section" id="id11">
1033 <span id="lazy-binding"></span><h2><a class="toc-backref" href="#id48">5.2 <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>
1044 <pre class="literal-block">
1045 template <typename A, typename K, typename F>
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>
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"><F()>::type</span></tt>.<a class="footnote-reference" href="#no-result-of" id="id12"><sup>2</sup></a></td>
1064 <div class="section" id="id13">
1065 <span id="value-type"></span><h2><a class="toc-backref" href="#id49">5.3 <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>
1076 <pre class="literal-block">
1077 template <typename A, typename K, typename D = void_>
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>
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><
1095 typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><A, K, D>::type
1098 <p class="last">… when <tt class="docutils literal">D</tt> is not a reference type.</p>
1104 <div class="section" id="id14">
1105 <span id="lazy-value-type"></span><h2><a class="toc-backref" href="#id50">5.4 <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>
1116 <pre class="literal-block">
1117 template <typename A, typename K, typename F>
1118 struct lazy_value_type
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>
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"><F()>::type</span></tt>.<a class="footnote-reference" href="#no-result-of" id="id15"><sup>2</sup></a></td>
1137 <div class="section" id="id16">
1138 <span id="are-tagged-arguments"></span><h2><a class="toc-backref" href="#id51">5.5 <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>
1147 <pre class="literal-block">
1148 template <typename T0, typename ...Pack>
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.
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>
1162 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
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 <typename B>
1174 class frontend : public B
1181 <a class="reference internal" href="#boost-parameter-no-spec-constructor"><tt class="docutils literal">BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR</tt></a>(frontend, (B))
1183 template <typename Iterator>
1187 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::disable_if</a><
1188 are_tagged_arguments<Iterator>
1190 >::type = _enabler()
1197 <div class="section" id="id17">
1198 <span id="is-argument-pack"></span><h2><a class="toc-backref" href="#id52">5.6 <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>
1207 <pre class="literal-block">
1208 template <typename T>
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.
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>
1222 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
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)
1232 template <typename T>
1242 template <typename ArgPack>
1244 ArgPack const& args
1245 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
1246 is_argument_pack<ArgPack>
1248 >::type = _enabler()
1253 template <typename U>
1255 backend0<U> const& copy
1256 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
1257 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a><U,T>
1259 >::type = _enabler()
1260 ) : a0(copy.get_a0())
1264 T const& get_a0() const
1271 <div class="section" id="id18">
1272 <span id="result-of-compose"></span><h2><a class="toc-backref" href="#id53">5.7 <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>
1282 <pre class="literal-block">
1283 template <typename ...TaggedArgs>
1285 : <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
1286 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><T0,Pack...>
1287 , <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a>
1293 struct compose<>
1295 typedef <em>empty</em> <a class="reference internal" href="#argumentpack"><span class="concept">ArgumentPack</span></a> type;
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
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>
1311 <hr class="docutils" />
1312 <div class="section" id="function-templates">
1313 <h1><a class="toc-backref" href="#id54">6 Function Templates</a></h1>
1314 <div class="section" id="id19">
1315 <span id="compose"></span><h2><a class="toc-backref" href="#id55">6.1 <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>
1324 <pre class="literal-block">
1325 template <typename ...Pack>
1326 constexpr typename <a class="reference internal" href="#result-of-compose"><tt class="docutils literal"><span class="pre">result_of::compose</span></tt></a><Pack...>::type
1327 compose(Pack const&... args);
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
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>
1355 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
1359 <pre class="literal-block">
1360 BOOST_PARAMETER_NAME(index)
1361 BOOST_PARAMETER_NAME(name)
1363 template <typename ArgumentPack>
1364 int print_name_and_index(ArgumentPack const& args)
1366 std::cout << "index = " << args[_index];
1367 std::cout << "name = " << args[_name];
1368 std::cout << "; " << std::endl;
1372 int y = print_name_and_index(compose(_index = 3, _name = "jones"));
1374 <p>The <a class="reference external" href="../../test/compose.cpp">compose.cpp</a> test program shows more examples using this function.</p>
1377 <hr class="docutils" />
1378 <div class="section" id="code-generation-macros">
1379 <h1><a class="toc-backref" href="#id56">7 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 <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>
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>
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 <std::size_t N>
1406 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
1408 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1411 template <std::size_t N>
1412 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
1414 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1417 template <std::size_t N>
1418 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
1420 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1424 template <std::size_t N>
1425 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
1427 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
1438 passed_by_lvalue_reference_to_const
1439 , passed_by_lvalue_reference
1440 , passed_by_rvalue_reference_to_const
1441 , passed_by_rvalue_reference
1446 template <std::size_t N>
1447 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
1449 return passed_by_lvalue_reference_to_const;
1452 template <std::size_t N>
1453 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
1455 return passed_by_lvalue_reference;
1458 template <std::size_t N>
1459 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
1461 return passed_by_rvalue_reference_to_const;
1464 template <std::size_t N>
1465 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
1467 return passed_by_rvalue_reference;
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))
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,
1498 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
1499 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
1502 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>), rvalue_const_bitset<2>())
1503 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>), rvalue_bitset<3>())
1509 passed_by_lvalue_reference_to_const
1510 , U::evaluate_category<0>(lrc)
1513 passed_by_lvalue_reference
1514 , U::evaluate_category<1>(lr)
1517 passed_by_rvalue_reference_to_const
1518 , U::evaluate_category<2>(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><rrc0_type>(rrc0))
1521 passed_by_rvalue_reference
1522 , U::evaluate_category<3>(args[_rr0])
1528 <p>The following function calls are legal.</p>
1529 <pre class="literal-block">
1530 evaluate( // positional arguments
1531 lvalue_const_bitset<0>()
1532 , lvalue_bitset<1>()
1533 , rvalue_const_bitset<2>()
1534 , rvalue_bitset<3>()
1536 evaluate( // positional arguments
1537 lvalue_const_bitset<0>()
1538 , lvalue_bitset<1>()
1540 evaluate(( // composed arguments
1541 _rr0 = rvalue_bitset<3>()
1542 , _lrc0 = lvalue_const_bitset<0>()
1543 , _lr0 = lvalue_bitset<1>()
1544 , _rrc0 = rvalue_const_bitset<2>()
1546 evaluate( // named arguments
1547 _rr0 = rvalue_bitset<3>()
1548 , _lrc0 = lvalue_const_bitset<0>()
1549 , _lr0 = lvalue_bitset<1>()
1550 , _rrc0 = rvalue_const_bitset<2>()
1552 evaluate( // named arguments
1553 _lr0 = lvalue_bitset<1>()
1554 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
1562 , lvalue_const_bitset<0>()
1563 , lvalue_bitset<1>()
1564 , rvalue_const_bitset<2>()
1566 evaluate( // deduced arguments
1567 lvalue_bitset<1>()
1568 , lvalue_const_bitset<0>()
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
1574 <p><strong>Macro parameters:</strong></p>
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>
1584 <p><strong>Argument specifiers syntax:</strong></p>
1585 <pre class="literal-block">
1586 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
1588 specifier-group0 ::= <em>specifier-group1</em> |
1590 '<strong>(</strong>' '<strong>deduced</strong>'
1591 <em>specifier-group1</em> {<em>specifier-group1</em>}
1592 '<strong>)</strong>'
1595 specifier-group1 ::=
1597 '<strong>(</strong>' '<strong>optional</strong>'
1598 <em>optional-specifier</em> {<em>optional-specifier</em>}
1599 '<strong>)</strong>'
1601 '<strong>(</strong>' '<strong>required</strong>'
1602 <em>required-specifier</em> {<em>required-specifier</em>}
1603 '<strong>)</strong>'
1606 optional-specifier ::=
1607 '<strong>(</strong>'
1608 <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
1611 required-specifier ::=
1612 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
1615 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
1616 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
1617 '<strong>*</strong>'
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>
1639 <p><strong>Approximate expansion:</strong></p>
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>
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 <typename Args>
1652 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
1654 // If <strong>result</strong> is a simple return type:
1655 template <typename Args>
1656 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
1658 typedef <strong>result</strong> type;
1661 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
1662 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
1663 <em>list of parameter specifications, based on arguments</em>
1668 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
1669 boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
1671 template <typename Args>
1672 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
1673 boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const&);
1675 template <typename A0, …, typename A ## <strong>n</strong>>
1676 <strong>result</strong> <strong>name</strong>(
1677 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
1678 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
1679 ::match<A0, …, A ## <strong>n</strong>>::type
1680 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
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><A0>(a0)
1687 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
1692 <span class="vellipsis">⋮</span>
1694 template <typename A0, …, typename A ## <strong>m</strong>>
1695 <strong>result</strong> <strong>name</strong>(
1696 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
1697 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
1698 ::match<A0, …, A ## <strong>m</strong>>::type
1699 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
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><A0>(a0)
1706 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
1714 , typename <em>argument name</em> ## <strong>0</strong> ## _type
1716 , typename <em>argument name</em> ## <strong>n</strong> ## _type
1719 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1721 , Args const& args
1722 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
1724 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
1727 <span class="vellipsis">⋮</span>
1732 , typename <em>argument name</em> ## <strong>0</strong> ## _type
1734 , typename <em>argument name</em> ## <strong>m</strong> ## _type
1737 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1739 , Args const& args
1740 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
1742 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
1745 template <typename Args>
1746 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
1747 boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const& args)
1749 return boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1751 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><
1754 >(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
1756 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
1757 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
1759 , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
1761 >(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
1763 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
1764 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
1766 , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
1768 >(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
1775 , typename <em>argument name</em> ## <strong>0</strong> ## _type
1777 , typename <em>argument name</em> ## <strong>n</strong> ## _type
1780 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1782 , Args const& args
1783 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
1785 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>n</strong>
1788 return boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1789 static_cast<ResultType(*)()>(<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>
1793 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>0</strong> ## _type>(
1794 <em>argument name</em> ## <strong>0</strong>
1797 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>n</strong> ## _type>(
1798 <em>argument name</em> ## <strong>n</strong>
1800 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
1801 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
1803 , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
1805 >(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
1809 <span class="vellipsis">⋮</span>
1814 , typename <em>argument name</em> ## <strong>0</strong> ## _type
1816 , typename <em>argument name</em> ## <strong>m</strong> ## _type
1819 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
1821 , Args const& args
1822 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
1824 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
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 <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>
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>
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 <std::size_t N>
1852 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
1854 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1857 template <std::size_t N>
1858 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
1860 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1863 template <std::size_t N>
1864 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
1866 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
1870 template <std::size_t N>
1871 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
1873 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
1884 passed_by_lvalue_reference_to_const
1885 , passed_by_lvalue_reference
1886 , passed_by_rvalue_reference_to_const
1887 , passed_by_rvalue_reference
1892 template <std::size_t N>
1893 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
1895 return passed_by_lvalue_reference_to_const;
1898 template <std::size_t N>
1899 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
1901 return passed_by_lvalue_reference;
1904 template <std::size_t N>
1905 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
1907 return passed_by_rvalue_reference_to_const;
1910 template <std::size_t N>
1911 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
1913 return passed_by_rvalue_reference;
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))
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">
1943 BOOST_PARAMETER_MEMBER_FUNCTION((bool), static evaluate, kw,
1946 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
1947 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
1950 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>), rvalue_const_bitset<2>())
1951 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>), rvalue_bitset<3>())
1957 passed_by_lvalue_reference_to_const
1958 , U::evaluate_category<0>(lrc)
1961 passed_by_lvalue_reference
1962 , U::evaluate_category<1>(lr)
1965 passed_by_rvalue_reference_to_const
1966 , U::evaluate_category<2>(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><rrc0_type>(rrc0))
1969 passed_by_rvalue_reference
1970 , U::evaluate_category<3>(args[_rr0])
1977 <p>The following function calls are legal.</p>
1978 <pre class="literal-block">
1979 B::evaluate( // positional arguments
1980 lvalue_const_bitset<0>()
1981 , lvalue_bitset<1>()
1982 , rvalue_const_bitset<2>()
1983 , rvalue_bitset<3>()
1985 B::evaluate( // positional arguments
1986 lvalue_const_bitset<0>()
1987 , lvalue_bitset<1>()
1989 B::evaluate(( // composed arguments
1990 _rr0 = rvalue_bitset<3>()
1991 , _lrc0 = lvalue_const_bitset<0>()
1992 , _lr0 = lvalue_bitset<1>()
1993 , _rrc0 = rvalue_const_bitset<2>()
1995 B::evaluate( // named arguments
1996 _rr0 = rvalue_bitset<3>()
1997 , _lrc0 = lvalue_const_bitset<0>()
1998 , _lr0 = lvalue_bitset<1>()
1999 , _rrc0 = rvalue_const_bitset<2>()
2001 B::evaluate( // named arguments
2002 _lr0 = lvalue_bitset<1>()
2003 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
2011 , lvalue_const_bitset<0>()
2012 , lvalue_bitset<1>()
2013 , rvalue_const_bitset<2>()
2015 B::evaluate( // deduced arguments
2016 lvalue_bitset<1>()
2017 , lvalue_const_bitset<0>()
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>
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>
2034 <p><strong>Argument specifiers syntax:</strong></p>
2035 <pre class="literal-block">
2036 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2038 specifier-group0 ::= <em>specifier-group1</em> |
2040 '<strong>(</strong>' '<strong>deduced</strong>'
2041 <em>specifier-group1</em> {<em>specifier-group1</em>}
2042 '<strong>)</strong>'
2045 specifier-group1 ::=
2047 '<strong>(</strong>' '<strong>optional</strong>'
2048 <em>optional-specifier</em> {<em>optional-specifier</em>}
2049 '<strong>)</strong>'
2051 '<strong>(</strong>' '<strong>required</strong>'
2052 <em>required-specifier</em> {<em>required-specifier</em>}
2053 '<strong>)</strong>'
2056 optional-specifier ::=
2057 '<strong>(</strong>'
2058 <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2061 required-specifier ::=
2062 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2065 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2066 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2067 '<strong>*</strong>'
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>
2089 <p><strong>Approximate expansion:</strong></p>
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>
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 <typename Args>
2102 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
2104 // If <strong>result</strong> is a simple return type:
2105 template <typename Args>
2106 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
2108 typedef <strong>result</strong> type;
2111 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
2112 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
2113 <em>list of parameter specifications, based on arguments</em>
2118 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
2119 boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
2121 template <typename A0, …, typename A ## <strong>n</strong>>
2122 <strong>result</strong> <strong>name</strong>(
2123 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
2124 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
2125 ::match<A0, …, A ## <strong>n</strong>>::type
2126 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
2129 return this->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><A0>(a0)
2133 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
2138 <span class="vellipsis">⋮</span>
2140 template <typename A0, …, typename A ## <strong>m</strong>>
2141 <strong>result</strong> <strong>name</strong>(
2142 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
2143 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
2144 ::match<A0, …, A ## <strong>m</strong>>::type
2145 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
2148 return this->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><A0>(a0)
2152 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
2157 template <typename Args>
2158 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
2159 boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const& args)
2161 return this->boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2163 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><
2166 >(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2168 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2169 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2171 , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2173 >(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2175 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2176 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2178 , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2180 >(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2187 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2189 , typename <em>argument name</em> ## <strong>n</strong> ## _type
2192 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2194 , Args const& args
2195 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2197 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>n</strong>
2200 return this->boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2201 static_cast<ResultType(*)()>(<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>
2205 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>0</strong> ## _type>(
2206 <em>argument name</em> ## <strong>0</strong>
2209 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>n</strong> ## _type>(
2210 <em>argument name</em> ## <strong>n</strong>
2212 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2213 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2215 , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2217 >(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2221 <span class="vellipsis">⋮</span>
2226 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2228 , typename <em>argument name</em> ## <strong>m</strong> ## _type
2231 boost_param_dispatch_0boost_ ## __LINE__ ## <strong>name</strong>(
2233 , Args const& args
2234 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2236 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
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 <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>
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>
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 <std::size_t N>
2264 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
2266 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
2269 template <std::size_t N>
2270 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
2272 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
2275 template <std::size_t N>
2276 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
2278 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
2282 template <std::size_t N>
2283 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
2285 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
2296 passed_by_lvalue_reference_to_const
2297 , passed_by_lvalue_reference
2298 , passed_by_rvalue_reference_to_const
2299 , passed_by_rvalue_reference
2304 template <std::size_t N>
2305 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
2307 return passed_by_lvalue_reference_to_const;
2310 template <std::size_t N>
2311 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
2313 return passed_by_lvalue_reference;
2316 template <std::size_t N>
2317 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
2319 return passed_by_rvalue_reference_to_const;
2322 template <std::size_t N>
2323 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
2325 return passed_by_rvalue_reference;
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))
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">
2359 BOOST_PARAMETER_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
2362 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
2363 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
2366 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>), rvalue_const_bitset<2>())
2367 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>), rvalue_bitset<3>())
2373 passed_by_lvalue_reference_to_const
2374 , U::evaluate_category<0>(lrc)
2377 passed_by_lvalue_reference
2378 , U::evaluate_category<1>(lr)
2381 passed_by_rvalue_reference_to_const
2382 , U::evaluate_category<2>(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><rrc0_type>(rrc0))
2385 passed_by_rvalue_reference
2386 , U::evaluate_category<3>(args[_rr0])
2393 <p>The following function calls are legal.</p>
2394 <pre class="literal-block">
2396 b.evaluate( // positional arguments
2397 lvalue_const_bitset<0>()
2398 , lvalue_bitset<1>()
2399 , rvalue_const_bitset<2>()
2400 , rvalue_bitset<3>()
2402 b.evaluate( // positional arguments
2403 lvalue_const_bitset<0>()
2404 , lvalue_bitset<1>()
2406 b.evaluate(( // composed arguments
2407 _rr0 = rvalue_bitset<3>()
2408 , _lrc0 = lvalue_const_bitset<0>()
2409 , _lr0 = lvalue_bitset<1>()
2410 , _rrc0 = rvalue_const_bitset<2>()
2412 b.evaluate( // named arguments
2413 _rr0 = rvalue_bitset<3>()
2414 , _lrc0 = lvalue_const_bitset<0>()
2415 , _lr0 = lvalue_bitset<1>()
2416 , _rrc0 = rvalue_const_bitset<2>()
2418 b.evaluate( // named arguments
2419 _lr0 = lvalue_bitset<1>()
2420 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
2428 , lvalue_const_bitset<0>()
2429 , lvalue_bitset<1>()
2430 , rvalue_const_bitset<2>()
2432 b.evaluate( // deduced arguments
2433 lvalue_bitset<1>()
2434 , lvalue_const_bitset<0>()
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>
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>
2448 <p><strong>Argument specifiers syntax:</strong></p>
2449 <pre class="literal-block">
2450 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2452 specifier-group0 ::= <em>specifier-group1</em> |
2454 '<strong>(</strong>' '<strong>deduced</strong>'
2455 <em>specifier-group1</em> {<em>specifier-group1</em>}
2456 '<strong>)</strong>'
2459 specifier-group1 ::=
2461 '<strong>(</strong>' '<strong>optional</strong>'
2462 <em>optional-specifier</em> {<em>optional-specifier</em>}
2463 '<strong>)</strong>'
2465 '<strong>(</strong>' '<strong>required</strong>'
2466 <em>required-specifier</em> {<em>required-specifier</em>}
2467 '<strong>)</strong>'
2470 optional-specifier ::=
2471 '<strong>(</strong>'
2472 <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2475 required-specifier ::=
2476 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2479 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2480 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2481 '<strong>*</strong>'
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>
2503 <p><strong>Approximate expansion:</strong></p>
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>
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 <typename Args>
2516 using boost_param_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
2518 // If <strong>result</strong> is a simple return type:
2519 template <typename Args>
2520 struct boost_param_result_const_ ## __LINE__ ## <strong>name</strong>
2522 typedef <strong>result</strong> type;
2525 struct boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
2526 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
2527 <em>list of parameter specifications, based on arguments</em>
2532 typedef boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
2533 boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>;
2535 template <typename A0, …, typename A ## <strong>n</strong>>
2536 <strong>result</strong> <strong>name</strong>(
2537 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
2538 , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
2539 ::match<A0, …, A ## <strong>n</strong>>::type
2540 = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
2543 return this->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><A0>(a0)
2547 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
2552 <span class="vellipsis">⋮</span>
2554 template <typename A0, …, typename A ## <strong>m</strong>>
2555 <strong>result</strong> <strong>name</strong>(
2556 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
2557 , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
2558 ::match<A0, …, A ## <strong>m</strong>>::type
2559 = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
2562 return this->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><A0>(a0)
2566 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
2571 template <typename Args>
2572 typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong><Args>::type
2573 boost_param_impl_const ## __LINE__ ## <strong>name</strong>(Args const& args) const
2576 boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2578 typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong><
2581 >(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2583 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2584 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2586 , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2588 >(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2590 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2591 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2593 , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2595 >(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2602 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2604 , typename <em>argument name</em> ## <strong>n</strong> ## _type
2607 boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2609 , Args const& args
2610 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2612 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>n</strong>
2616 boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2617 static_cast<ResultType(*)()>(<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>
2621 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>0</strong> ## _type>(
2622 <em>argument name</em> ## <strong>0</strong>
2625 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>n</strong> ## _type>(
2626 <em>argument name</em> ## <strong>n</strong>
2628 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2629 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2631 , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2633 >(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2637 <span class="vellipsis">⋮</span>
2642 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2644 , typename <em>argument name</em> ## <strong>m</strong> ## _type
2647 boost_param_dispatch_const_0boost_ ## __LINE__ ## <strong>name</strong>(
2649 , Args const& args
2650 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2652 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
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 <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>
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>
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)
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">
2696 explicit char_reader(char const* k) : index(0), key(k)
2700 BOOST_PARAMETER_FUNCTION_CALL_OPERATOR((void), tag,
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,
2717 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>>))
2723 (z.find(this->key)->second)[this->index]
2724 ) : this->key[this->index];
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[] = {"foo", "bar", "baz"};
2732 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>> k2s;
2733 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("qux");
2734 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("wmb");
2735 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("zxc");
2736 char_reader r(keys[0]);
2738 // positional arguments
2739 BOOST_TEST_EQ('q', (r(true, k2s)));
2740 BOOST_TEST_EQ('f', (r(false, k2s)));
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)));
2747 // deduced arguments
2749 BOOST_TEST_EQ('c', (r(k2s, true)));
2750 BOOST_TEST_EQ('z', (r(k2s, false)));
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>
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>
2762 <p><strong>Argument specifiers syntax:</strong></p>
2763 <pre class="literal-block">
2764 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
2766 specifier-group0 ::= <em>specifier-group1</em> |
2768 '<strong>(</strong>' '<strong>deduced</strong>'
2769 <em>specifier-group1</em> {<em>specifier-group1</em>}
2770 '<strong>)</strong>'
2773 specifier-group1 ::=
2775 '<strong>(</strong>' '<strong>optional</strong>'
2776 <em>optional-specifier</em> {<em>optional-specifier</em>}
2777 '<strong>)</strong>'
2779 '<strong>(</strong>' '<strong>required</strong>'
2780 <em>required-specifier</em> {<em>required-specifier</em>}
2781 '<strong>)</strong>'
2784 optional-specifier ::=
2785 '<strong>(</strong>'
2786 <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
2789 required-specifier ::=
2790 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
2793 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
2794 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
2795 '<strong>*</strong>'
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>
2817 <p><strong>Approximate expansion:</strong></p>
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>
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 <typename Args>
2830 using boost_param_result_ ## __LINE__ ## operator = <strong>result</strong>;
2832 // If <strong>result</strong> is a simple return type:
2833 template <typename Args>
2834 struct boost_param_result_ ## __LINE__ ## operator
2836 typedef <strong>result</strong> type;
2839 struct boost_param_params_ ## __LINE__ ## operator
2840 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
2841 <em>list of parameter specifications, based on arguments</em>
2846 typedef boost_param_params_ ## __LINE__ ## operator
2847 boost_param_parameters_ ## __LINE__ ## operator;
2849 template <typename A0, …, typename A ## <strong>n</strong>>
2850 <strong>result</strong> operator()(
2851 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
2852 , typename boost_param_parameters_ ## __LINE__ ## operator::match<
2853 A0, …, A ## <strong>n</strong>
2854 >::type = boost_param_parameters_ ## __LINE__ ## operator()
2857 return this->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><A0>(a0)
2861 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
2866 <span class="vellipsis">⋮</span>
2868 template <typename A0, …, typename A ## <strong>m</strong>>
2869 <strong>result</strong> operator()(
2870 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
2871 , typename boost_param_parameters_ ## __LINE__ ## operator::match<
2872 A0, …, A ## <strong>m</strong>
2873 >::type = boost_param_parameters_ ## __LINE__ ## operator()
2876 return this->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><A0>(a0)
2880 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
2885 template <typename Args>
2886 typename boost_param_result_ ## __LINE__ ## operator<Args>::type
2887 boost_param_impl ## __LINE__ ## operator(Args const& args)
2889 return this->boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2891 typename boost_param_result_ ## __LINE__ ## operator<
2894 >(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
2896 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2897 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2899 , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
2901 >(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
2903 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2904 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2906 , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
2908 >(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
2915 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2917 , typename <em>argument name</em> ## <strong>n</strong> ## _type
2920 boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2922 , Args const& args
2923 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2925 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>n</strong>
2928 return this->boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2929 static_cast<ResultType(*)()>(<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>
2933 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>0</strong> ## _type>(
2934 <em>argument name</em> ## <strong>0</strong>
2937 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>n</strong> ## _type>(
2938 <em>argument name</em> ## <strong>n</strong>
2940 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
2941 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
2943 , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
2945 >(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
2949 <span class="vellipsis">⋮</span>
2954 , typename <em>argument name</em> ## <strong>0</strong> ## _type
2956 , typename <em>argument name</em> ## <strong>m</strong> ## _type
2959 boost_param_dispatch_0boost_ ## __LINE__ ## operator(
2961 , Args const& args
2962 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
2964 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
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 <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>
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>
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 <std::size_t N>
2992 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
2994 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
2997 template <std::size_t N>
2998 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
3000 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3003 template <std::size_t N>
3004 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
3006 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3010 template <std::size_t N>
3011 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
3013 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
3024 passed_by_lvalue_reference_to_const
3025 , passed_by_lvalue_reference
3026 , passed_by_rvalue_reference_to_const
3027 , passed_by_rvalue_reference
3032 template <std::size_t N>
3033 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
3035 return passed_by_lvalue_reference_to_const;
3038 template <std::size_t N>
3039 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
3041 return passed_by_lvalue_reference;
3044 template <std::size_t N>
3045 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
3047 return passed_by_rvalue_reference_to_const;
3050 template <std::size_t N>
3051 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
3053 return passed_by_rvalue_reference;
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))
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">
3087 BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
3090 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
3091 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
3094 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>), rvalue_const_bitset<2>())
3095 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>), rvalue_bitset<3>())
3101 passed_by_lvalue_reference_to_const
3102 , U::evaluate_category<0>(lrc)
3105 passed_by_lvalue_reference
3106 , U::evaluate_category<1>(lr)
3109 passed_by_rvalue_reference_to_const
3110 , U::evaluate_category<2>(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><rrc0_type>(rrc0))
3113 passed_by_rvalue_reference
3114 , U::evaluate_category<3>(args[_rr0])
3121 <p>The following function calls are legal.</p>
3122 <pre class="literal-block">
3124 b( // positional arguments
3125 lvalue_const_bitset<0>()
3126 , lvalue_bitset<1>()
3127 , rvalue_const_bitset<2>()
3128 , rvalue_bitset<3>()
3130 b( // positional arguments
3131 lvalue_const_bitset<0>()
3132 , lvalue_bitset<1>()
3134 b(( // composed arguments
3135 _rr0 = rvalue_bitset<3>()
3136 , _lrc0 = lvalue_const_bitset<0>()
3137 , _lr0 = lvalue_bitset<1>()
3138 , _rrc0 = rvalue_const_bitset<2>()
3140 b( // named arguments
3141 _rr0 = rvalue_bitset<3>()
3142 , _lrc0 = lvalue_const_bitset<0>()
3143 , _lr0 = lvalue_bitset<1>()
3144 , _rrc0 = rvalue_const_bitset<2>()
3146 b( // named arguments
3147 _lr0 = lvalue_bitset<1>()
3148 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
3156 , lvalue_const_bitset<0>()
3157 , lvalue_bitset<1>()
3158 , rvalue_const_bitset<2>()
3160 b( // deduced arguments
3161 lvalue_bitset<1>()
3162 , lvalue_const_bitset<0>()
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
3168 <p><strong>Macro parameters:</strong></p>
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>
3176 <p><strong>Argument specifiers syntax:</strong></p>
3177 <pre class="literal-block">
3178 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3180 specifier-group0 ::= <em>specifier-group1</em> |
3182 '<strong>(</strong>' '<strong>deduced</strong>'
3183 <em>specifier-group1</em> {<em>specifier-group1</em>}
3184 '<strong>)</strong>'
3187 specifier-group1 ::=
3189 '<strong>(</strong>' '<strong>optional</strong>'
3190 <em>optional-specifier</em> {<em>optional-specifier</em>}
3191 '<strong>)</strong>'
3193 '<strong>(</strong>' '<strong>required</strong>'
3194 <em>required-specifier</em> {<em>required-specifier</em>}
3195 '<strong>)</strong>'
3198 optional-specifier ::=
3199 '<strong>(</strong>'
3200 <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> '<strong>,</strong>' <em>default-value</em>
3203 required-specifier ::=
3204 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3207 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3208 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3209 '<strong>*</strong>'
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>
3231 <p><strong>Approximate expansion:</strong></p>
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>
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 <typename Args>
3244 using boost_param_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
3246 // If <strong>result</strong> is a simple return type:
3247 template <typename Args>
3248 struct boost_param_result_const_ ## __LINE__ ## operator
3250 typedef <strong>result</strong> type;
3253 struct boost_param_params_const_ ## __LINE__ ## operator
3254 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
3255 <em>list of parameter specifications, based on arguments</em>
3260 typedef boost_param_params_const_ ## __LINE__ ## operator
3261 boost_param_parameters_const_ ## __LINE__ ## operator;
3263 template <typename A0, …, typename A ## <strong>n</strong>>
3264 <strong>result</strong> operator()(
3265 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
3266 , typename boost_param_parameters_const_ ## __LINE__ ## operator
3267 ::match<A0, …, A ## <strong>n</strong>>::type
3268 = boost_param_parameters_const_ ## __LINE__ ## operator()
3271 return this->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><A0>(a0)
3275 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
3280 <span class="vellipsis">⋮</span>
3282 template <typename A0, …, typename A ## <strong>m</strong>>
3283 <strong>result</strong> operator()(
3284 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
3285 , typename boost_param_parameters_const_ ## __LINE__ ## operator
3286 ::match<A0, …, A ## <strong>m</strong>>::type
3287 = boost_param_parameters_const_ ## __LINE__ ## operator()
3290 return this->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><A0>(a0)
3294 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
3299 template <typename Args>
3300 typename boost_param_result_const_ ## __LINE__ ## operator<Args>::type
3301 boost_param_impl_const ## __LINE__ ## operator(Args const& args) const
3304 boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3306 typename boost_param_result_const_ ## __LINE__ ## operator<
3309 >(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
3311 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
3312 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
3314 , <em>keyword tag type of required parameter</em> ## <strong>0</strong>
3316 >(args[ <em>keyword object of required parameter</em> ## <strong>0</strong>])
3318 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
3319 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
3321 , <em>keyword tag type of required parameter</em> ## <strong>n</strong>
3323 >(args[ <em>keyword object of required parameter</em> ## <strong>n</strong>])
3330 , typename <em>argument name</em> ## <strong>0</strong> ## _type
3332 , typename <em>argument name</em> ## <strong>n</strong> ## _type
3335 boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3337 , Args const& args
3338 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
3340 , <em>argument name</em> ## <strong>n</strong> ## _type&& <em>argument name</em> ## <strong>n</strong>
3344 boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3345 static_cast<ResultType(*)()>(<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>
3349 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>0</strong> ## _type>(
3350 <em>argument name</em> ## <strong>0</strong>
3353 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><<em>argument name</em> ## <strong>n</strong> ## _type>(
3354 <em>argument name</em> ## <strong>n</strong>
3356 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><
3357 typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><
3359 , <em>keyword tag type of optional parameter</em> ## <strong>n + 1</strong>
3361 >(<em>default value of optional parameter</em> ## <strong>n + 1</strong>)
3365 <span class="vellipsis">⋮</span>
3370 , typename <em>argument name</em> ## <strong>0</strong> ## _type
3372 , typename <em>argument name</em> ## <strong>m</strong> ## _type
3375 boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
3377 , Args const& args
3378 , <em>argument name</em> ## <strong>0</strong> ## _type&& <em>argument name</em> ## <strong>0</strong>
3380 , <em>argument name</em> ## <strong>m</strong> ## _type&& <em>argument name</em> ## <strong>m</strong>
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 <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>
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>
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)
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
3421 template <typename Args>
3422 explicit char_read_base(Args const& args)
3423 : index(args[_y]), key(args[_z])
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,
3431 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>>))
3437 (z.find(this->key)->second)[this->index]
3438 ) : this->key[this->index];
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
3450 BOOST_PARAMETER_CONSTRUCTOR(char_reader, (char_read_base), tag,
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[] = {"foo", "bar", "baz"};
3463 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>> k2s;
3464 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("qux");
3465 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("wmb");
3466 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("zxc");
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)));
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)));
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)));
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>
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>
3493 <p><strong>Argument specifiers syntax:</strong></p>
3494 <pre class="literal-block">
3495 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3497 specifier-group0 ::= <em>specifier-group1</em> |
3499 '<strong>(</strong>' '<strong>deduced</strong>'
3500 <em>specifier-group1</em> {<em>specifier-group1</em>}
3501 '<strong>)</strong>'
3504 specifier-group1 ::=
3506 '<strong>(</strong>' '<strong>optional</strong>'
3507 <em>specifier</em> {<em>specifier</em>}
3508 '<strong>)</strong>'
3510 '<strong>(</strong>' '<strong>required</strong>'
3511 <em>specifier</em> {<em>specifier</em>}
3512 '<strong>)</strong>'
3516 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3519 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3520 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3521 '<strong>*</strong>'
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>
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>
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>
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><
3547 <em>list of parameter specifications, based on arguments</em>
3552 typedef boost_param_params_ ## __LINE__ ## ctor
3553 constructor_parameters ## __LINE__;
3555 template <typename A0, …, typename A ## <strong>n</strong>>
3556 <strong>cls</strong>(A0&& a0, …, A ## <strong>n</strong> && 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><A0>(a0)
3561 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
3567 <span class="vellipsis">⋮</span>
3569 template <typename A0, …, typename A ## <strong>m</strong>>
3570 <strong>cls</strong>(A0&& a0, …, A ## <strong>m</strong> && 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><A0>(a0)
3575 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
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 <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>
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>
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 <std::size_t N>
3606 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
3608 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3611 template <std::size_t N>
3612 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
3614 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3617 template <std::size_t N>
3618 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
3620 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3624 template <std::size_t N>
3625 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
3627 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
3638 passed_by_lvalue_reference_to_const
3639 , passed_by_lvalue_reference
3640 , passed_by_rvalue_reference_to_const
3641 , passed_by_rvalue_reference
3646 template <std::size_t N>
3647 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
3649 return passed_by_lvalue_reference_to_const;
3652 template <std::size_t N>
3653 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
3655 return passed_by_lvalue_reference;
3658 template <std::size_t N>
3659 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
3661 return passed_by_rvalue_reference_to_const;
3664 template <std::size_t N>
3665 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
3667 return passed_by_rvalue_reference;
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))
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,
3698 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
3699 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
3702 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>))
3703 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>))
3709 passed_by_lvalue_reference_to_const
3710 , U::evaluate_category<0>(args[_lrc])
3713 passed_by_lvalue_reference
3714 , U::evaluate_category<1>(args[_lr])
3717 passed_by_rvalue_reference_to_const
3718 , U::evaluate_category<2>(
3719 args[_rrc0 | rvalue_const_bitset<2>()]
3723 passed_by_rvalue_reference
3724 , U::evaluate_category<3>(args[_rr0 | rvalue_bitset<3>()])
3730 <p>The following function calls are legal.</p>
3731 <pre class="literal-block">
3732 evaluate( // positional arguments
3733 lvalue_const_bitset<0>()
3734 , lvalue_bitset<1>()
3735 , rvalue_const_bitset<2>()
3736 , rvalue_bitset<3>()
3738 evaluate( // positional arguments
3739 lvalue_const_bitset<0>()
3740 , lvalue_bitset<1>()
3742 evaluate(( // composed arguments
3743 _rr0 = rvalue_bitset<3>()
3744 , _lrc0 = lvalue_const_bitset<0>()
3745 , _lr0 = lvalue_bitset<1>()
3746 , _rrc0 = rvalue_const_bitset<2>()
3748 evaluate( // named arguments
3749 _rr0 = rvalue_bitset<3>()
3750 , _lrc0 = lvalue_const_bitset<0>()
3751 , _lr0 = lvalue_bitset<1>()
3752 , _rrc0 = rvalue_const_bitset<2>()
3754 evaluate( // named arguments
3755 _lr0 = lvalue_bitset<1>()
3756 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
3764 , lvalue_const_bitset<0>()
3765 , lvalue_bitset<1>()
3766 , rvalue_const_bitset<2>()
3768 evaluate( // deduced arguments
3769 lvalue_bitset<1>()
3770 , lvalue_const_bitset<0>()
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>
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>
3784 <p><strong>Argument specifiers syntax:</strong></p>
3785 <pre class="literal-block">
3786 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
3788 specifier-group0 ::= <em>specifier-group1</em> |
3790 '<strong>(</strong>' '<strong>deduced</strong>'
3791 <em>specifier-group1</em> {<em>specifier-group1</em>}
3792 '<strong>)</strong>'
3795 specifier-group1 ::=
3797 '<strong>(</strong>' '<strong>optional</strong>'
3798 <em>specifier</em> {<em>specifier</em>}
3799 '<strong>)</strong>'
3801 '<strong>(</strong>' '<strong>required</strong>'
3802 <em>specifier</em> {<em>specifier</em>}
3803 '<strong>)</strong>'
3807 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
3810 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
3811 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
3812 '<strong>*</strong>'
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>
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>
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>
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 <typename Args>
3841 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
3843 // If <strong>result</strong> is a simple return type:
3844 template <typename Args>
3845 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
3847 typedef <strong>result</strong> type;
3850 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
3851 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
3852 <em>list of parameter specifications, based on arguments</em>
3857 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
3858 boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
3860 template <typename Args>
3861 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
3862 boost_param_impl ## <strong>name</strong>(Args const&);
3864 template <typename A0, …, typename A ## <strong>n</strong>>
3865 <strong>result</strong> <strong>name</strong>(
3866 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
3867 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
3868 ::match<A0, …, A ## <strong>n</strong>>::type
3869 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
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><A0>(a0)
3876 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
3881 <span class="vellipsis">⋮</span>
3883 template <typename A0, …, typename A ## <strong>m</strong>>
3884 <strong>result</strong> <strong>name</strong>(
3885 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
3886 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
3887 ::match<A0, …, A ## <strong>m</strong>>::type
3888 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
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><A0>(a0)
3895 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
3900 template <typename Args>
3901 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
3902 boost_param_impl ## __LINE__ ## <strong>name</strong>(Args const& args)
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>
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 <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>
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>
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 <std::size_t N>
3931 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
3933 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3936 template <std::size_t N>
3937 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
3939 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3942 template <std::size_t N>
3943 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
3945 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
3949 template <std::size_t N>
3950 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
3952 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
3963 passed_by_lvalue_reference_to_const
3964 , passed_by_lvalue_reference
3965 , passed_by_rvalue_reference_to_const
3966 , passed_by_rvalue_reference
3971 template <std::size_t N>
3972 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
3974 return passed_by_lvalue_reference_to_const;
3977 template <std::size_t N>
3978 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
3980 return passed_by_lvalue_reference;
3983 template <std::size_t N>
3984 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
3986 return passed_by_rvalue_reference_to_const;
3989 template <std::size_t N>
3990 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
3992 return passed_by_rvalue_reference;
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))
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">
4022 BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((bool), static evaluate, kw,
4025 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
4026 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
4029 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>))
4030 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>))
4036 passed_by_lvalue_reference_to_const
4037 , U::evaluate_category<0>(args[_lrc])
4040 passed_by_lvalue_reference
4041 , U::evaluate_category<1>(args[_lr])
4044 passed_by_rvalue_reference_to_const
4045 , U::evaluate_category<2>(
4046 args[_rrc0 | rvalue_const_bitset<2>()]
4050 passed_by_rvalue_reference
4051 , U::evaluate_category<3>(
4052 args[_rr0 | rvalue_bitset<3>()]
4060 <p>The following function calls are legal.</p>
4061 <pre class="literal-block">
4062 B::evaluate( // positional arguments
4063 lvalue_const_bitset<0>()
4064 , lvalue_bitset<1>()
4065 , rvalue_const_bitset<2>()
4066 , rvalue_bitset<3>()
4068 B::evaluate( // positional arguments
4069 lvalue_const_bitset<0>()
4070 , lvalue_bitset<1>()
4072 B::evaluate(( // composed arguments
4073 _rr0 = rvalue_bitset<3>()
4074 , _lrc0 = lvalue_const_bitset<0>()
4075 , _lr0 = lvalue_bitset<1>()
4076 , _rrc0 = rvalue_const_bitset<2>()
4078 B::evaluate( // named arguments
4079 _rr0 = rvalue_bitset<3>()
4080 , _lrc0 = lvalue_const_bitset<0>()
4081 , _lr0 = lvalue_bitset<1>()
4082 , _rrc0 = rvalue_const_bitset<2>()
4084 B::evaluate( // named arguments
4085 _lr0 = lvalue_bitset<1>()
4086 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
4094 , lvalue_const_bitset<0>()
4095 , lvalue_bitset<1>()
4096 , rvalue_const_bitset<2>()
4098 B::evaluate( // deduced arguments
4099 lvalue_bitset<1>()
4100 , lvalue_const_bitset<0>()
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>
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>
4116 <p><strong>Argument specifiers syntax:</strong></p>
4117 <pre class="literal-block">
4118 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4120 specifier-group0 ::= <em>specifier-group1</em> |
4122 '<strong>(</strong>' '<strong>deduced</strong>'
4123 <em>specifier-group1</em> {<em>specifier-group1</em>}
4124 '<strong>)</strong>'
4127 specifier-group1 ::=
4129 '<strong>(</strong>' '<strong>optional</strong>'
4130 <em>specifier</em> {<em>specifier</em>}
4131 '<strong>)</strong>'
4133 '<strong>(</strong>' '<strong>required</strong>'
4134 <em>specifier</em> {<em>specifier</em>}
4135 '<strong>)</strong>'
4139 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4142 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4143 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4144 '<strong>*</strong>'
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>
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>
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>
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 <typename Args>
4173 using boost_param_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
4175 // If <strong>result</strong> is a simple return type:
4176 template <typename Args>
4177 struct boost_param_result_ ## __LINE__ ## <strong>name</strong>
4179 typedef <strong>result</strong> type;
4182 struct boost_param_params_ ## __LINE__ ## <strong>name</strong>
4183 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
4184 <em>list of parameter specifications, based on arguments</em>
4189 typedef boost_param_params_ ## __LINE__ ## <strong>name</strong>
4190 boost_param_parameters_ ## __LINE__ ## <strong>name</strong>;
4192 template <typename A0, …, typename A ## <strong>n</strong>>
4193 <strong>result</strong> <strong>name</strong>(
4194 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
4195 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
4196 ::match<A0, …, A ## <strong>n</strong>>::type
4197 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
4200 return this->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><A0>(a0)
4204 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
4209 <span class="vellipsis">⋮</span>
4211 template <typename A0, …, typename A ## <strong>m</strong>>
4212 <strong>result</strong> <strong>name</strong>(
4213 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
4214 , typename boost_param_parameters_ ## __LINE__ ## <strong>name</strong>
4215 ::match<A0, …, A ## <strong>m</strong>>::type
4216 = boost_param_parameters_ ## __LINE__ ## <strong>name</strong>()
4219 return this->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><A0>(a0)
4223 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
4228 template <typename Args>
4229 typename boost_param_result_ ## __LINE__ ## <strong>name</strong><Args>::type
4230 boost_param_impl ## <strong>name</strong>(Args const& args)
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>
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 <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>
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>
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 <std::size_t N>
4259 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
4261 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4264 template <std::size_t N>
4265 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
4267 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4270 template <std::size_t N>
4271 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
4273 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4277 template <std::size_t N>
4278 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
4280 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
4291 passed_by_lvalue_reference_to_const
4292 , passed_by_lvalue_reference
4293 , passed_by_rvalue_reference_to_const
4294 , passed_by_rvalue_reference
4299 template <std::size_t N>
4300 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
4302 return passed_by_lvalue_reference_to_const;
4305 template <std::size_t N>
4306 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
4308 return passed_by_lvalue_reference;
4311 template <std::size_t N>
4312 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
4314 return passed_by_rvalue_reference_to_const;
4317 template <std::size_t N>
4318 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
4320 return passed_by_rvalue_reference;
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))
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">
4354 BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
4357 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
4358 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
4361 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>))
4362 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>))
4368 passed_by_lvalue_reference_to_const
4369 , U::evaluate_category<0>(args[_lrc])
4372 passed_by_lvalue_reference
4373 , U::evaluate_category<1>(args[_lr])
4376 passed_by_rvalue_reference_to_const
4377 , U::evaluate_category<2>(
4378 args[_rrc0 | rvalue_const_bitset<2>()]
4382 passed_by_rvalue_reference
4383 , U::evaluate_category<3>(
4384 args[_rr0 | rvalue_bitset<3>()]
4392 <p>The following function calls are legal.</p>
4393 <pre class="literal-block">
4395 b.evaluate( // positional arguments
4396 lvalue_const_bitset<0>()
4397 , lvalue_bitset<1>()
4398 , rvalue_const_bitset<2>()
4399 , rvalue_bitset<3>()
4401 b.evaluate( // positional arguments
4402 lvalue_const_bitset<0>()
4403 , lvalue_bitset<1>()
4405 b.evaluate(( // composed arguments
4406 _rr0 = rvalue_bitset<3>()
4407 , _lrc0 = lvalue_const_bitset<0>()
4408 , _lr0 = lvalue_bitset<1>()
4409 , _rrc0 = rvalue_const_bitset<2>()
4411 b.evaluate( // named arguments
4412 _rr0 = rvalue_bitset<3>()
4413 , _lrc0 = lvalue_const_bitset<0>()
4414 , _lr0 = lvalue_bitset<1>()
4415 , _rrc0 = rvalue_const_bitset<2>()
4417 b.evaluate( // named arguments
4418 _lr0 = lvalue_bitset<1>()
4419 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
4427 , lvalue_const_bitset<0>()
4428 , lvalue_bitset<1>()
4429 , rvalue_const_bitset<2>()
4431 b.evaluate( // deduced arguments
4432 lvalue_bitset<1>()
4433 , lvalue_const_bitset<0>()
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>
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>
4447 <p><strong>Argument specifiers syntax:</strong></p>
4448 <pre class="literal-block">
4449 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4451 specifier-group0 ::= <em>specifier-group1</em> |
4453 '<strong>(</strong>' '<strong>deduced</strong>'
4454 <em>specifier-group1</em> {<em>specifier-group1</em>}
4455 '<strong>)</strong>'
4458 specifier-group1 ::=
4460 '<strong>(</strong>' '<strong>optional</strong>'
4461 <em>specifier</em> {<em>specifier</em>}
4462 '<strong>)</strong>'
4464 '<strong>(</strong>' '<strong>required</strong>'
4465 <em>specifier</em> {<em>specifier</em>}
4466 '<strong>)</strong>'
4470 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4473 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4474 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4475 '<strong>*</strong>'
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>
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>
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>
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 <typename Args>
4504 using boost_param_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
4506 // If <strong>result</strong> is a simple return type:
4507 template <typename Args>
4508 struct boost_param_result_const_ ## __LINE__ ## <strong>name</strong>
4510 typedef <strong>result</strong> type;
4513 struct boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
4514 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
4515 <em>list of parameter specifications, based on arguments</em>
4520 typedef boost_param_params_const_ ## __LINE__ ## <strong>name</strong>
4521 boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>;
4523 template <typename A0, …, typename A ## <strong>n</strong>>
4524 <strong>result</strong> <strong>name</strong>(
4525 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
4526 , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
4527 ::match<A0, …, A ## <strong>n</strong>>::type
4528 = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
4531 return this->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><A0>(a0)
4535 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
4540 <span class="vellipsis">⋮</span>
4542 template <typename A0, …, typename A ## <strong>m</strong>>
4543 <strong>result</strong> <strong>name</strong>(
4544 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
4545 , typename boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>
4546 ::match<A0, …, A ## <strong>m</strong>>::type
4547 = boost_param_parameters_const_ ## __LINE__ ## <strong>name</strong>()
4550 return this->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><A0>(a0)
4554 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
4559 template <typename Args>
4560 typename boost_param_result_const_ ## __LINE__ ## <strong>name</strong><Args>::type
4561 boost_param_impl_const ## __LINE__ ## <strong>name</strong>(Args const& args) const
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>
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 <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>
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>
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)
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">
4606 explicit char_reader(char const* k) : index(0), key(k)
4610 BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR((void), tag,
4619 this->index = args[_y];
4620 this->key = args[_z];
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,
4627 (z, (<a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>>))
4633 (args[_z].find(this->key)->second)[this->index]
4634 ) : this->key[this->index];
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[] = {"foo", "bar", "baz"};
4642 <a class="reference external" href="http://en.cppreference.com/w/cpp/container/map">std::map</a><char const*, <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>> k2s;
4643 k2s[keys[0]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("qux");
4644 k2s[keys[1]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("wmb");
4645 k2s[keys[2]] = <a class="reference external" href="http://en.cppreference.com/w/cpp/string/basic_string">std::string</a>("zxc");
4646 char_reader r(keys[0]);
4648 // positional arguments
4649 BOOST_TEST_EQ('q', (r(true, k2s)));
4650 BOOST_TEST_EQ('f', (r(false, k2s)));
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)));
4657 // deduced arguments
4659 BOOST_TEST_EQ('c', (r(k2s, true)));
4660 BOOST_TEST_EQ('z', (r(k2s, false)));
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>
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>
4671 <p><strong>Argument specifiers syntax:</strong></p>
4672 <pre class="literal-block">
4673 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
4675 specifier-group0 ::= <em>specifier-group1</em> |
4677 '<strong>(</strong>' '<strong>deduced</strong>'
4678 <em>specifier-group1</em> {<em>specifier-group1</em>}
4679 '<strong>)</strong>'
4682 specifier-group1 ::=
4684 '<strong>(</strong>' '<strong>optional</strong>'
4685 <em>specifier</em> {<em>specifier</em>}
4686 '<strong>)</strong>'
4688 '<strong>(</strong>' '<strong>required</strong>'
4689 <em>specifier</em> {<em>specifier</em>}
4690 '<strong>)</strong>'
4694 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
4697 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
4698 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
4699 '<strong>*</strong>'
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>
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>
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>
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 <typename Args>
4728 using boost_param_result_ ## __LINE__ ## operator = <strong>result</strong>;
4730 // If <strong>result</strong> is a simple return type:
4731 template <typename Args>
4732 struct boost_param_result_ ## __LINE__ ## operator
4734 typedef <strong>result</strong> type;
4737 struct boost_param_params_ ## __LINE__ ## operator
4738 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
4739 <em>list of parameter specifications, based on arguments</em>
4744 typedef boost_param_params_ ## __LINE__ ## operator
4745 boost_param_parameters_ ## __LINE__ ## operator;
4747 template <typename A0, …, typename A ## <strong>n</strong>>
4748 <strong>result</strong> operator()(
4749 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
4750 , typename boost_param_parameters_ ## __LINE__ ## operator::match<
4751 A0, …, A ## <strong>n</strong>
4752 >::type = boost_param_parameters_ ## __LINE__ ## operator()
4755 return this->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><A0>(a0)
4759 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
4764 <span class="vellipsis">⋮</span>
4766 template <typename A0, …, typename A ## <strong>m</strong>>
4767 <strong>result</strong> operator()(
4768 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
4769 , typename boost_param_parameters_ ## __LINE__ ## operator::match<
4770 A0, …, A ## <strong>m</strong>
4771 >::type = boost_param_parameters_ ## __LINE__ ## operator()
4774 return this->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><A0>(a0)
4778 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
4783 template <typename Args>
4784 typename boost_param_result_ ## __LINE__ ## operator<Args>::type
4785 boost_param_impl ## __LINE__ ## operator(Args const& args)
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>
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 <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>
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>
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 <std::size_t N>
4814 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
4816 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4819 template <std::size_t N>
4820 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
4822 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4825 template <std::size_t N>
4826 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
4828 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
4832 template <std::size_t N>
4833 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
4835 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
4846 passed_by_lvalue_reference_to_const
4847 , passed_by_lvalue_reference
4848 , passed_by_rvalue_reference_to_const
4849 , passed_by_rvalue_reference
4854 template <std::size_t N>
4855 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
4857 return passed_by_lvalue_reference_to_const;
4860 template <std::size_t N>
4861 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
4863 return passed_by_lvalue_reference;
4866 template <std::size_t N>
4867 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
4869 return passed_by_rvalue_reference_to_const;
4872 template <std::size_t N>
4873 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
4875 return passed_by_rvalue_reference;
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))
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">
4909 BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
4912 (lrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><1>))
4913 (lr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><2>))
4916 (rrc, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><3>))
4917 (rr, (<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><4>))
4923 passed_by_lvalue_reference_to_const
4924 , U::evaluate_category<0>(args[_lrc])
4927 passed_by_lvalue_reference
4928 , U::evaluate_category<1>(args[_lr])
4931 passed_by_rvalue_reference_to_const
4932 , U::evaluate_category<2>(
4933 args[_rrc0 | rvalue_const_bitset<2>()]
4937 passed_by_rvalue_reference
4938 , U::evaluate_category<3>(
4939 args[_rr0 | rvalue_bitset<3>()]
4947 <p>The following function calls are legal.</p>
4948 <pre class="literal-block">
4950 b( // positional arguments
4951 lvalue_const_bitset<0>()
4952 , lvalue_bitset<1>()
4953 , rvalue_const_bitset<2>()
4954 , rvalue_bitset<3>()
4956 b( // positional arguments
4957 lvalue_const_bitset<0>()
4958 , lvalue_bitset<1>()
4960 b(( // composed arguments
4961 _rr0 = rvalue_bitset<3>()
4962 , _lrc0 = lvalue_const_bitset<0>()
4963 , _lr0 = lvalue_bitset<1>()
4964 , _rrc0 = rvalue_const_bitset<2>()
4966 b( // named arguments
4967 _rr0 = rvalue_bitset<3>()
4968 , _lrc0 = lvalue_const_bitset<0>()
4969 , _lr0 = lvalue_bitset<1>()
4970 , _rrc0 = rvalue_const_bitset<2>()
4972 b( // named arguments
4973 _lr0 = lvalue_bitset<1>()
4974 , _lrc0 = lvalue_const_bitset<0>()
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<3>()
4982 , lvalue_const_bitset<0>()
4983 , lvalue_bitset<1>()
4984 , rvalue_const_bitset<2>()
4986 b( // deduced arguments
4987 lvalue_bitset<1>()
4988 , lvalue_const_bitset<0>()
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>
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>
5000 <p><strong>Argument specifiers syntax:</strong></p>
5001 <pre class="literal-block">
5002 argument-specifiers ::= <em>specifier-group0</em> {<em>specifier-group0</em>}
5004 specifier-group0 ::= <em>specifier-group1</em> |
5006 '<strong>(</strong>' '<strong>deduced</strong>'
5007 <em>specifier-group1</em> {<em>specifier-group1</em>}
5008 '<strong>)</strong>'
5011 specifier-group1 ::=
5013 '<strong>(</strong>' '<strong>optional</strong>'
5014 <em>specifier</em> {<em>specifier</em>}
5015 '<strong>)</strong>'
5017 '<strong>(</strong>' '<strong>required</strong>'
5018 <em>specifier</em> {<em>specifier</em>}
5019 '<strong>)</strong>'
5023 '<strong>(</strong>' <em>argument-name</em> '<strong>,</strong>' <em>restriction</em> ')'
5026 ( '<strong>*</strong>' '<strong>(</strong>' <em>mfc</em> '<strong>)</strong>' ) |
5027 ( '<strong>(</strong>' <em>type-name</em> '<strong>)</strong>' ) |
5028 '<strong>*</strong>'
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>
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>
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>
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 <typename Args>
5057 using boost_param_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
5059 // If <strong>result</strong> is a simple return type:
5060 template <typename Args>
5061 struct boost_param_result_const_ ## __LINE__ ## operator
5063 typedef <strong>result</strong> type;
5066 struct boost_param_params_const_ ## __LINE__ ## operator
5067 : <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
5068 <em>list of parameter specifications, based on arguments</em>
5073 typedef boost_param_params_const_ ## __LINE__ ## operator
5074 boost_param_parameters_const_ ## __LINE__ ## operator;
5076 template <typename A0, …, typename A ## <strong>n</strong>>
5077 <strong>result</strong> operator()(
5078 A0&& a0, …, A ## <strong>n</strong>&& a ## <strong>n</strong>
5079 , typename boost_param_parameters_const_ ## __LINE__ ## operator
5080 ::match<A0, …, A ## <strong>n</strong>>::type
5081 = boost_param_parameters_const_ ## __LINE__ ## operator()
5084 return this->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><A0>(a0)
5088 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>n</strong>>(a ## <strong>n</strong>)
5093 <span class="vellipsis">⋮</span>
5095 template <typename A0, …, typename A ## <strong>m</strong>>
5096 <strong>result</strong> operator()(
5097 A0&& a0, …, A ## <strong>m</strong>&& a ## <strong>m</strong>
5098 , typename boost_param_parameters_const_ ## __LINE__ ## operator
5099 ::match<A0, …, A ## <strong>m</strong>>::type
5100 = boost_param_parameters_const_ ## __LINE__ ## operator()
5103 return this->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><A0>(a0)
5107 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>m</strong>>(a ## <strong>m</strong>)
5112 template <typename Args>
5113 typename boost_param_result_const_ ## __LINE__ ## operator<Args>::type
5114 boost_param_impl_const ## __LINE__ ## operator(Args const& args) const
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>
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 <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>
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>
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 <std::size_t N>
5142 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
5144 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5147 template <std::size_t N>
5148 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
5150 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5153 template <std::size_t N>
5154 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
5156 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5160 template <std::size_t N>
5161 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
5163 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
5174 passed_by_lvalue_reference_to_const
5175 , passed_by_lvalue_reference
5176 , passed_by_rvalue_reference_to_const
5177 , passed_by_rvalue_reference
5182 template <std::size_t N>
5183 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
5185 return passed_by_lvalue_reference_to_const;
5188 template <std::size_t N>
5189 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
5191 return passed_by_lvalue_reference;
5194 template <std::size_t N>
5195 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
5197 return passed_by_rvalue_reference_to_const;
5200 template <std::size_t N>
5201 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
5203 return passed_by_rvalue_reference;
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))
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)
5221 passed_by_lvalue_reference_to_const
5222 , U::evaluate_category<0>(args[_lrc])
5225 passed_by_lvalue_reference
5226 , U::evaluate_category<1>(args[_lr])
5229 passed_by_rvalue_reference_to_const
5230 , U::evaluate_category<2>(
5231 args[_rrc | rvalue_const_bitset<2>()]
5235 passed_by_rvalue_reference
5236 , U::evaluate_category<3>(args[_rr | rvalue_bitset<3>()])
5242 <p>To invoke the function, bind all its arguments to named parameters.</p>
5243 <pre class="literal-block">
5245 _rr0 = rvalue_bitset<3>()
5246 , _lrc0 = lvalue_const_bitset<0>()
5247 , _lr0 = lvalue_bitset<1>()
5248 , _rrc0 = rvalue_const_bitset<2>()
5251 _lr0 = lvalue_bitset<1>()
5252 , _lrc0 = lvalue_const_bitset<0>()
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
5257 <p><strong>Macro parameters:</strong></p>
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>
5263 <p><strong>Argument specifiers syntax:</strong></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 <typename TaggedArg0, typename ...TaggedArgs>
5273 using boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5275 // If <strong>result</strong> is a simple return type:
5276 template <typename TaggedArg0, typename ...TaggedArgs>
5277 struct boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>
5279 typedef <strong>result</strong> type;
5282 template <typename ResultType, typename Args>
5284 boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5286 , Args const& args
5289 template <typename TaggedArg0, typename ...TaggedArgs>
5290 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a><
5291 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
5292 , boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong><
5297 <strong>name</strong>(TaggedArg0 const& arg0, TaggedArgs const&... args)
5299 return boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5302 boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong><
5306 >(<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...)
5311 template <typename ResultType, typename Args>
5313 boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5315 , Args const& args
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>
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 <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>
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>
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 <typename B>
5352 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION((void), initialize)
5354 this->initialize_impl(args);
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)
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 <typename T>
5379 T const& get_a0() const
5385 template <typename ArgPack>
5386 void initialize_impl(ArgPack const& args)
5388 this->a0 = args[_a0];
5392 template <typename B, typename T>
5393 class backend1 : public B
5398 backend1() : B(), a1()
5402 T const& get_a1() const
5408 template <typename ArgPack>
5409 void initialize_impl(ArgPack const& args)
5411 B::initialize_impl(args);
5412 this->a1 = args[_a1];
5416 template <typename B, typename T>
5417 class backend2 : public B
5422 backend2() : B(), a2()
5426 T const& get_a2() const
5432 template <typename ArgPack>
5433 void initialize_impl(ArgPack const& args)
5435 B::initialize_impl(args);
5436 this->a2 = args[_a2];
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 = "foo";
5446 backend2<backend1<backend0<char const*>, char>, int>
5449 backend1<backend2<backend0<char const*>, int>, char>
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());
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>
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>
5467 <p><strong>Argument specifiers syntax:</strong></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 <typename TaggedArg0, typename ...TaggedArgs>
5477 using boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5479 // If <strong>result</strong> is a simple return type:
5480 template <typename TaggedArg0, typename ...TaggedArgs>
5481 struct boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong>
5483 typedef <strong>result</strong> type;
5486 template <typename TaggedArg0, typename ...TaggedArgs>
5487 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a><
5488 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
5489 , boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong><
5494 <strong>name</strong>(TaggedArg0 const& arg0, TaggedArgs const&... args)
5496 return this->boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5499 boost_param_no_spec_result_ ## __LINE__ ## <strong>name</strong><
5503 >(<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...)
5508 template <typename ResultType, typename Args>
5510 boost_param_no_spec_impl ## __LINE__ ## <strong>name</strong>(
5512 , Args const& args
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>
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 <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>
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>
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 <std::size_t N>
5541 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
5543 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5546 template <std::size_t N>
5547 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
5549 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5552 template <std::size_t N>
5553 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
5555 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5559 template <std::size_t N>
5560 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
5562 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
5573 passed_by_lvalue_reference_to_const
5574 , passed_by_lvalue_reference
5575 , passed_by_rvalue_reference_to_const
5576 , passed_by_rvalue_reference
5581 template <std::size_t N>
5582 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
5584 return passed_by_lvalue_reference_to_const;
5587 template <std::size_t N>
5588 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
5590 return passed_by_lvalue_reference;
5593 template <std::size_t N>
5594 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
5596 return passed_by_rvalue_reference_to_const;
5599 template <std::size_t N>
5600 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
5602 return passed_by_rvalue_reference;
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))
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">
5624 BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION((bool), evaluate_m)
5627 passed_by_lvalue_reference_to_const
5628 , U::evaluate_category<0>(args[_lrc])
5631 passed_by_lvalue_reference
5632 , U::evaluate_category<1>(args[_lr])
5635 passed_by_rvalue_reference_to_const
5636 , U::evaluate_category<2>(
5637 args[_rrc | rvalue_const_bitset<2>()]
5641 passed_by_rvalue_reference
5642 , U::evaluate_category<3>(
5643 args[_rr | rvalue_bitset<3>()]
5651 <p>To invoke the member function, bind all its arguments to named parameters.</p>
5652 <pre class="literal-block">
5655 _rr0 = rvalue_bitset<3>()
5656 , _lrc0 = lvalue_const_bitset<0>()
5657 , _lr0 = lvalue_bitset<1>()
5658 , _rrc0 = rvalue_const_bitset<2>()
5661 _lr0 = lvalue_bitset<1>()
5662 , _lrc0 = lvalue_const_bitset<0>()
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
5667 <p><strong>Macro parameters:</strong></p>
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>
5673 <p><strong>Argument specifiers syntax:</strong></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 <typename TaggedArg0, typename ...TaggedArgs>
5683 using boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong> = <strong>result</strong>;
5685 // If <strong>result</strong> is a simple return type:
5686 template <typename TaggedArg0, typename ...TaggedArgs>
5687 struct boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong>
5689 typedef <strong>result</strong> type;
5692 template <typename TaggedArg0, typename ...TaggedArgs>
5693 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a><
5694 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
5695 , boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong><
5700 <strong>name</strong>(TaggedArg0 const& arg0, TaggedArgs const&... args) const
5702 return this->boost_param_no_spec_impl_const ## __LINE__ ## <strong>name</strong>(
5705 boost_param_no_spec_result_const_ ## __LINE__ ## <strong>name</strong><
5709 >(<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...)
5714 template <typename ResultType, typename Args>
5716 boost_param_no_spec_impl_const ## __LINE__ ## <strong>name</strong>(
5718 , Args const& args
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>
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 <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>
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>
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 <typename B>
5755 BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR((void))
5757 this->initialize_impl(args);
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)
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 <typename T>
5782 T const& get_a0() const
5788 template <typename ArgPack>
5789 void initialize_impl(ArgPack const& args)
5791 this->a0 = args[_a0];
5795 template <typename B, typename T>
5796 class backend1 : public B
5801 backend1() : B(), a1()
5805 T const& get_a1() const
5811 template <typename ArgPack>
5812 void initialize_impl(ArgPack const& args)
5814 B::initialize_impl(args);
5815 this->a1 = args[_a1];
5819 template <typename B, typename T>
5820 class backend2 : public B
5825 backend2() : B(), a2()
5829 T const& get_a2() const
5835 template <typename ArgPack>
5836 void initialize_impl(ArgPack const& args)
5838 B::initialize_impl(args);
5839 this->a2 = args[_a2];
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 = "foo";
5849 backend2<backend1<backend0<char const*>, char>, int>
5852 backend1<backend2<backend0<char const*>, int>, char>
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());
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>
5864 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
5866 <p><strong>Argument specifiers syntax:</strong></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 <typename TaggedArg0, typename ...TaggedArgs>
5876 using boost_param_no_spec_result_ ## __LINE__ ## operator = <strong>result</strong>;
5878 // If <strong>result</strong> is a simple return type:
5879 template <typename TaggedArg0, typename ...TaggedArgs>
5880 struct boost_param_no_spec_result_ ## __LINE__ ## operator
5882 typedef <strong>result</strong> type;
5885 template <typename TaggedArg0, typename ...TaggedArgs>
5886 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a><
5887 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
5888 , boost_param_no_spec_result_ ## __LINE__ ## operator<
5893 operator()(TaggedArg0 const& arg0, TaggedArgs const&... args)
5895 return this->boost_param_no_spec_impl ## __LINE__ ## operator(
5898 boost_param_no_spec_result_ ## __LINE__ ## operator<
5902 >(<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...)
5907 template <typename ResultType, typename Args>
5909 boost_param_no_spec_impl ## __LINE__ ## operator(
5911 , Args const& args
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>
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 <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>
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>
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 <std::size_t N>
5940 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
5942 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5945 template <std::size_t N>
5946 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
5948 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5951 template <std::size_t N>
5952 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
5954 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
5958 template <std::size_t N>
5959 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
5961 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
5972 passed_by_lvalue_reference_to_const
5973 , passed_by_lvalue_reference
5974 , passed_by_rvalue_reference_to_const
5975 , passed_by_rvalue_reference
5980 template <std::size_t N>
5981 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
5983 return passed_by_lvalue_reference_to_const;
5986 template <std::size_t N>
5987 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
5989 return passed_by_lvalue_reference;
5992 template <std::size_t N>
5993 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
5995 return passed_by_rvalue_reference_to_const;
5998 template <std::size_t N>
5999 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
6001 return passed_by_rvalue_reference;
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))
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">
6023 BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR((bool))
6026 passed_by_lvalue_reference_to_const
6027 , U::evaluate_category<0>(args[_lrc])
6030 passed_by_lvalue_reference
6031 , U::evaluate_category<1>(args[_lr])
6034 passed_by_rvalue_reference_to_const
6035 , U::evaluate_category<2>(
6036 args[_rrc | rvalue_const_bitset<2>()]
6040 passed_by_rvalue_reference
6041 , U::evaluate_category<3>(
6042 args[_rr | rvalue_bitset<3>()]
6050 <p>To invoke the function call operator, bind all its arguments to named
6052 <pre class="literal-block">
6055 _rr0 = rvalue_bitset<3>()
6056 , _lrc0 = lvalue_const_bitset<0>()
6057 , _lr0 = lvalue_bitset<1>()
6058 , _rrc0 = rvalue_const_bitset<2>()
6061 _lr0 = lvalue_bitset<1>()
6062 , _lrc0 = lvalue_const_bitset<0>()
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
6067 <p><strong>Macro parameters:</strong></p>
6069 <li><tt class="docutils literal">result</tt> is the parenthesized return type of the function call operator.</li>
6071 <p><strong>Argument specifiers syntax:</strong></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 <typename TaggedArg0, typename ...TaggedArgs>
6081 using boost_param_no_spec_result_const_ ## __LINE__ ## operator = <strong>result</strong>;
6083 // If <strong>result</strong> is a simple return type:
6084 template <typename TaggedArg0, typename ...TaggedArgs>
6085 struct boost_param_no_spec_result_const_ ## __LINE__ ## operator
6087 typedef <strong>result</strong> type;
6090 template <typename TaggedArg0, typename ...TaggedArgs>
6091 inline typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::lazy_enable_if</a><
6092 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
6093 , boost_param_no_spec_result_const_ ## __LINE__ ## operator<
6099 TaggedArg0 const& arg0
6100 , TaggedArgs const&... args
6103 return this->boost_param_no_spec_impl_const ## __LINE__ ## operator(
6106 boost_param_no_spec_result_const_ ## __LINE__ ## operator<
6110 >(<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...)
6115 template <typename ResultType, typename Args>
6117 boost_param_no_spec_impl_const ## __LINE__ ## operator(
6119 , Args const& args
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>
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 <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>
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>
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 <typename B>
6152 BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
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)
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">
6170 template <typename T>
6176 template <typename ArgPack>
6178 ArgPack const& args
6179 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
6180 <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a><ArgPack>
6182 >::type = _enabler()
6187 T const& get_a0() const
6193 template <typename B, typename T>
6194 class backend1 : public B
6199 template <typename ArgPack>
6201 ArgPack const& args
6202 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
6203 <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a><ArgPack>
6205 >::type = _enabler()
6206 ) : B(args), a1(args[_a1])
6210 T const& get_a1() const
6216 template <typename B, typename T>
6217 class backend2 : public B
6222 template <typename ArgPack>
6224 ArgPack const& args
6225 , typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
6226 <a class="reference internal" href="#is-argument-pack"><tt class="docutils literal">is_argument_pack</tt></a><ArgPack>
6228 >::type = _enabler()
6229 ) : B(args), a2(args[_a2])
6233 T const& get_a2() const
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 = "foo";
6245 backend2<backend1<backend0<char const*>, char>, int>
6246 > composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
6248 backend1<backend2<backend0<char const*>, int>, char>
6249 > 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());
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>
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>
6261 <p><strong>Argument specifiers syntax:</strong></p>
6263 <p><strong>Approximate expansion:</strong></p>
6264 <pre class="literal-block">
6267 , typename ...TaggedArgs
6268 , typename = typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
6269 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
6272 inline explicit <strong>cls</strong>(
6273 TaggedArg0 const& arg0
6274 , TaggedArgs const&... args
6275 ) : <strong>impl</strong>(<a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...))
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 <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>
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>
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 <std::size_t N>
6303 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> rvalue_bitset()
6305 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
6308 template <std::size_t N>
6309 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const rvalue_const_bitset()
6311 return <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
6314 template <std::size_t N>
6315 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>& lvalue_bitset()
6317 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> lset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
6321 template <std::size_t N>
6322 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const& lvalue_const_bitset()
6324 static <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const clset = <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>();
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">
6335 passed_by_lvalue_reference_to_const
6336 , passed_by_lvalue_reference
6337 , passed_by_rvalue_reference_to_const
6338 , passed_by_rvalue_reference
6343 template <std::size_t N>
6344 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&)
6346 return passed_by_lvalue_reference_to_const;
6349 template <std::size_t N>
6350 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&)
6352 return passed_by_lvalue_reference;
6355 template <std::size_t N>
6356 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1> const&&)
6358 return passed_by_rvalue_reference_to_const;
6361 template <std::size_t N>
6362 static invoked evaluate_category(<a class="reference external" href="http://en.cppreference.com/w/cpp/utility/bitset">std::bitset</a><N + 1>&&)
6364 return passed_by_rvalue_reference;
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))
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">
6382 BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(D, D::_evaluate)
6385 template <typename Args>
6386 static bool _evaluate(Args const& args)
6389 passed_by_lvalue_reference_to_const
6390 , U::evaluate_category<0>(args[_lrc])
6393 passed_by_lvalue_reference
6394 , U::evaluate_category<1>(args[_lr])
6397 passed_by_rvalue_reference_to_const
6398 , U::evaluate_category<2>(
6399 args[_rrc | rvalue_const_bitset<2>()]
6403 passed_by_rvalue_reference
6404 , U::evaluate_category<3>(
6405 args[_rr | rvalue_bitset<3>()]
6413 <p>To invoke the constructor, bind all its arguments to named parameters.</p>
6414 <pre class="literal-block">
6416 _rr0 = rvalue_bitset<3>()
6417 , _lrc0 = lvalue_const_bitset<0>()
6418 , _lr0 = lvalue_bitset<1>()
6419 , _rrc0 = rvalue_const_bitset<2>()
6422 _lr0 = lvalue_bitset<1>()
6423 , _lrc0 = lvalue_const_bitset<0>()
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
6428 <p><strong>Macro parameters:</strong></p>
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>
6434 <p><strong>Argument specifiers syntax:</strong></p>
6436 <p><strong>Approximate expansion:</strong></p>
6437 <pre class="literal-block">
6440 , typename ...TaggedArgs
6441 , typename = typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><
6442 <a class="reference internal" href="#are-tagged-arguments"><tt class="docutils literal">are_tagged_arguments</tt></a><TaggedArg0,TaggedArgs...>
6445 inline explicit <strong>cls</strong>(
6446 TaggedArg0 const& arg0
6447 , TaggedArgs const&... args
6450 <strong>func</strong>(<a class="reference internal" href="#compose"><tt class="docutils literal">compose</tt></a>(arg0, args...));
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 <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>
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>)
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>
6477 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6481 <pre class="literal-block">
6482 namespace <em>namespace-name</em> {
6484 struct <em>tag-name</em>
6486 static constexpr char const* keyword_name()
6488 return ## <em>tag-name</em>;
6491 typedef <em>unspecified</em> _;
6492 typedef <em>unspecified</em> _1;
6493 typedef boost::parameter::<em>qualifier</em> ## _reference qualifier;
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.
6498 template <typename ArgumentPack>
6499 using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><
6504 template <typename ArgumentPack>
6505 using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><ArgumentPack, <em>tag-name</em>>::type;
6509 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>tag-namespace</em>::<em>tag-name</em>> const& <em>object-name</em>
6510 = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>tag-namespace</em>::<em>tag-name</em>>::instance;
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>
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>
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>)
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>
6533 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6537 <pre class="literal-block">
6540 struct <em>tag-name</em>
6542 static constexpr char const* keyword_name()
6544 return ## <em>tag-name</em>;
6547 typedef <em>unspecified</em> _;
6548 typedef <em>unspecified</em> _1;
6549 typedef boost::parameter::<em>qualifier</em> ## _reference qualifier;
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.
6554 template <typename ArgumentPack>
6555 using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><
6560 template <typename ArgumentPack>
6561 using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><ArgumentPack, <em>tag-name</em>>::type;
6565 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tag::<em>tag-name</em>> const& _ ## <em>tag-name</em>
6566 = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tag::<em>tag-name</em>>::instance;
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>)
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 <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>
6584 <p>Declares a tag-type, a keyword object, and an alias for that object nested in
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>)
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>
6598 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6602 <pre class="literal-block">
6605 struct <em>tag-name</em>
6607 static constexpr char const* keyword_name()
6609 return ## <em>tag-name</em> ## _;
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><<em>tag-name</em>> const& <em>alias</em>;
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.
6620 template <typename ArgumentPack>
6621 using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><
6626 template <typename ArgumentPack>
6627 using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><ArgumentPack, <em>tag-name</em>>::type;
6630 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>tag-name</em>> const& tag::<em>tag-name</em>::<em>alias</em>
6631 = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>tag-name</em>>::instance;
6634 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tag::<em>tag-name</em>> const& tag::<em>tag-name</em>::<em>name</em>
6635 = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><tag::<em>tag-name</em>>::instance;
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>)
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 <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>
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>
6653 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6657 <pre class="literal-block">
6660 struct <em>name</em>;
6663 template <typename T>
6664 struct <em>name</em> : <a class="reference internal" href="#template-keyword"><tt class="docutils literal">template_keyword</tt></a><tag:: <em>name</em>, T>
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
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 <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>
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>
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> < <tt class="docutils literal">h</tt></td>
6691 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6695 <pre class="literal-block">
6696 template <typename A1, typename A2, …, typename A ## <strong>l</strong>>
6699 A1 && a1, A2 && a2, …, A ## <strong>l</strong> && a ## <strong>l</strong>
6700 , typename <strong>p</strong>::match<A1, A2, …, A ## <strong>l</strong>>::type p = <strong>p</strong>()
6703 return <strong>name</strong>_with_named_params(
6705 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A1>(a1)
6706 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A2>(a2)
6708 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>l</strong>>(a ## <strong>l</strong>)
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>)
6722 A1 && a1, A2 && a2, …, A ## <strong>l</strong> && a ## <strong>l</strong>
6723 , A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>) const& a ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6724 , typename <strong>p</strong>::match<
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 >::type p = <strong>p</strong>()
6729 return <strong>name</strong>_with_named_params(
6731 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A1>(a1)
6732 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A2>(a2)
6734 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>l</strong>>(a ## <strong>l</strong>)
6735 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)>(
6736 a ## <a class="reference external" href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC</a>(<strong>l</strong>)
6742 <span class="vellipsis">⋮</span>
6744 template <typename A1, typename A2, …, typename A ## <strong>h</strong>>
6747 A1 && a1, A2 && a2, …, A ## <strong>h</strong> && x ## <strong>h</strong>
6748 , typename <strong>p</strong>::match<A1, A2, …, A ## <strong>h</strong>>::type p = <strong>p</strong>()
6751 return <strong>name</strong>_with_named_params(
6753 <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A1>(a1)
6754 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A2>(a2)
6756 , <a class="reference external" href="http://en.cppreference.com/w/cpp/utility/forward">std::forward</a><A ## <strong>h</strong>>(a ## <strong>h</strong>)
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>
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 <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>
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>
6780 <tr class="field"><th class="field-name">Expands to:</th><td class="field-body"></td>
6784 <pre class="literal-block">
6785 namespace <strong>n</strong> {
6787 struct <strong>k</strong>
6789 static constexpr char const* keyword_name()
6791 return ## <em>k</em>;
6794 typedef <em>unspecified</em> _;
6795 typedef <em>unspecified</em> _1;
6796 typedef boost::parameter::forward_reference qualifier;
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.
6801 template <typename ArgumentPack>
6802 using binding_fn = typename <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><
6807 template <typename ArgumentPack>
6808 using fn = typename <a class="reference internal" href="#value-type"><tt class="docutils literal">value_type</tt></a><ArgumentPack, <em>k</em>>::type;
6814 <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>n</em>::<strong>k</strong>> const& <strong>k</strong>
6815 = <a class="reference internal" href="#keyword"><tt class="docutils literal">keyword</tt></a><<em>n</em>::<strong>k</strong>>::instance;
6819 <div class="section" id="boost-parameter-match-p-a-x">
6820 <h2><a class="toc-backref" href="#id80">7.24 <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>
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>
6832 <pre class="literal-block">
6833 (A0)(A1)…(A ## <em>n</em>)
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>
6843 <pre class="literal-block">
6844 typename <strong>p</strong>::match<<strong>A0</strong>, <strong>A1</strong>, …, <strong>A</strong> ## <em>n</em>>::type
6845 <strong>x</strong> = <strong>p</strong>()
6849 <div class="section" id="configuration-macros">
6850 <h1><a class="toc-backref" href="#id81">8 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 <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>
6871 <div class="section" id="id22">
6872 <span id="boost-parameter-disable-perfect-forwarding"></span><h2><a class="toc-backref" href="#id83">8.2 <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>
6879 <div class="section" id="id23">
6880 <span id="boost-parameter-can-use-mp11"></span><h2><a class="toc-backref" href="#id84">8.3 <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>
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>
6905 <tr class="field"><th class="field-name">Example usage:</th><td class="field-body"></td>
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)
6913 template <typename A0>
6914 typename <a class="reference external" href="../../../core/doc/html/core/enable_if.html">boost::enable_if</a><<a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_same">std::is_same</a><int,A0>,int>::type
6915 sfinae(A0 const& a0)
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 <typename T, typename Args>
6923 using predicate = <a class="reference external" href="http://en.cppreference.com/w/cpp/types/is_convertible">std::is_convertible</a><T,char const*>;
6925 <a class="reference internal" href="#boost-parameter-function"><tt class="docutils literal">BOOST_PARAMETER_FUNCTION</tt></a>((int), sfinae, tag,
6929 , *(<a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_quotef">boost::mp11::mp_quote</a><predicate>)
6930 , static_cast<char const*>(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
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">
6943 template <typename T, typename Args>
6945 : <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
6946 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a><T,char const*>
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>.
6954 <a class="reference internal" href="#boost-parameter-function"><tt class="docutils literal">BOOST_PARAMETER_FUNCTION</tt></a>((int), sfinae, tag,
6959 , static_cast<char const*>(<a class="reference external" href="http://en.cppreference.com/w/cpp/language/nullptr">std::nullptr</a>)
6968 <p>Either way, the following assertions will succeed:</p>
6969 <pre class="literal-block">
6970 assert(1 == sfinae());
6971 assert(1 == sfinae("foo"));
6972 assert(0 == sfinae(1));
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)
6979 template <typename E, typename Args>
6980 void check0(E const& e, Args const& args);
6982 template <typename P, typename E, typename ...Args>
6983 void check(E const& e, Args const&... args)
6985 check0(e, P()(args...));
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 <typename Args>
6994 template <typename K>
6995 void operator()(K&&) const
6997 // K is one of tag::x, tag::y, etc.
7001 template <typename E, typename Args>
7002 void check0(E const& e, Args const& args)
7004 boost::mp11::mp_for_each<E>(some_functor<Args>());
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.
7015 <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
7017 , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><
7018 <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a><tag::y>
7019 , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bindf_t">boost::mp11::mp_bind</a><
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><
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.
7029 >((_x = 0, _y = 1), 0, 1);
7031 // Use mp_bind_q on tag::x to access the value type of _x.
7033 <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
7035 , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><
7036 <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a><tag::y>
7037 , <a class="reference external" href="../../../mp11/doc/html/mp11.html#mp_bindf_t">boost::mp11::mp_bind</a><
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><
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.
7047 >((_x = 0U, _y = 1U), 0U, 1U);
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 <typename Args>
7055 template <typename K>
7056 void operator()(K) const
7058 // K is one of tag::x, tag::y, etc.
7062 template <typename E, typename Args>
7063 void check0(E const& e, Args const& args)
7065 boost::mpl::for_each<E>(some_functor<Args>());
7068 <p>However, without <a class="reference external" href="../../../mp11/doc/html/mp11.html">Boost.MP11</a>, the corresponding checks become a little more
7070 <pre class="literal-block">
7072 <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
7074 , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><
7075 <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a><tag::y>
7076 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
7077 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_same.html">boost::is_same</a><
7078 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/add_lvalue_reference.html">boost::add_lvalue_reference</a><<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a>>
7079 , <a class="reference internal" href="#binding"><tt class="docutils literal">binding</tt></a><<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_2</a>, tag::x>
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>.
7086 >((_x = 0, _y = 1), 0, 1);
7088 // Use tag::x::_ or tag::x::_1 to access the value type of _x.
7090 <a class="reference internal" href="#parameters"><tt class="docutils literal">parameters</tt></a><
7092 , <a class="reference internal" href="#optional"><tt class="docutils literal">optional</tt></a><
7093 <a class="reference internal" href="#deduced"><tt class="docutils literal">deduced</tt></a><tag::y>
7094 , <a class="reference external" href="../../../mpl/doc/refmanual/if.html">mpl::if_</a><
7095 <a class="reference external" href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html">boost::is_convertible</a><<a class="reference external" href="../../../mp11/doc/html/mp11.html#1_9">boost::mp11::_1</a>, tag::x::_1>
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>.
7101 >((_x = 0U, _y = 1U), 0U, 1U);
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
7107 <div class="section" id="id24">
7108 <span id="boost-parameter-disable-mp11-usage"></span><h2><a class="toc-backref" href="#id85">8.4 <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>
7114 <div class="section" id="id25">
7115 <span id="boost-parameter-variadic-mpl-sequence"></span><h2><a class="toc-backref" href="#id86">8.5 <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>
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>
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>
7144 <div class="section" id="id26">
7145 <span id="boost-parameter-max-arity"></span><h2><a class="toc-backref" href="#id87">8.6 <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>
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
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>
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>
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>
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>
7171 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">2</tt></td>
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>
7178 <div class="section" id="id27">
7179 <span id="boost-parameter-compose-max-arity"></span><h2><a class="toc-backref" href="#id88">8.7 <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>
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>
7197 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">2</tt></td>
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 <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>
7216 <tr class="field"><th class="field-name">Default Value:</th><td class="field-body"><tt class="docutils literal">0</tt></td>
7218 <tr class="field"><th class="field-name">Minimum Value:</th><td class="field-body"><tt class="docutils literal">0</tt></td>
7223 <div class="section" id="outside-of-this-library">
7224 <h2><a class="toc-backref" href="#id90">8.9 ...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>
7283 <div class="section" id="tutorial">
7284 <h1><a class="toc-backref" href="#id91">9 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>
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"><F()>::type</span></tt> is replaced by <tt class="docutils literal"><span class="pre">F::result_type</span></tt>.</td></tr>
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.