<p>You can think of <ttclass="literal"><spanclass="pre">mpl::apply</span></tt> as being just like the <ttclass="literal"><spanclass="pre">apply1</span></tt>
template that we wrote, with two additional features:</p>
<olclass="arabic">
<li><pclass="first">While <ttclass="literal"><spanclass="pre">apply1</span></tt> operates only on metafunction classes, the first
argument to <ttclass="literal"><spanclass="pre">mpl::apply</span></tt> can be any lambda expression
(including those built with placeholders).</p>
</li>
<li><pclass="first">While <ttclass="literal"><spanclass="pre">apply1</span></tt> accepts only one additional argument to which
the metafunction class will be applied, <ttclass="literal"><spanclass="pre">mpl::apply</span></tt> can
invoke its first argument on any number from zero to five
additional arguments. <aclass="footnote-reference"href="#arity"id="id11"name="id11">[5]</a> For example:</p>
<preclass="literal-block">
// binary lambda expression applied to 2 additional arguments
<tr><tdclass="label"><aclass="fn-backref"href="#id11"name="arity">[5]</a></td><td>See the Configuration Macros section of the <aclass="reference"href="./reference-manual.html">the MPL reference manual</a>
for a description of how to change the maximum number of
arguments handled by <ttclass="literal"><spanclass="pre">mpl::apply</span></tt>.</td></tr>
</tbody>
</table>
<!-- @ prefix+=['#include <boost/mpl/plus.hpp>']
example.wrap('enum { is13 = ','''};
BOOST_STATIC_ASSERT(is13 == 13);''')
compile() -->
<divclass="admonition-guideline admonition">
<pclass="admonition-title first">Guideline</p>
<p>When writing a metafunction that invokes one of its arguments,
use <ttclass="literal"><spanclass="pre">mpl::apply</span></tt> so that it works with lambda expressions.</p>