Files
boost_mpl/doc/ref/Reference/BOOST_MPL_AUX_LAMBDA_SUPPORT.html
T
2003-11-12 07:55:12 +00:00

50 lines
1.9 KiB
HTML

<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::BOOST_MPL_AUX_LAMBDA_SUPPORT</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>BOOST_MPL_AUX_LAMBDA_SUPPORT</h1><h3>Synopsis</h3>
<p>
<pre>
#define BOOST_MPL_AUX_LAMBDA_SUPPORT(arity, fun, params) \
<em>unspecified token sequence</em> \
/**/
</pre>
<p>
<h3>Description</h3>
<p>
Broken compiler workaround macro, enables metafunction <code>fun</code> for the use in lambda expressions on compilers that don't support partial template specialization or/and template template parameters. Expands to nothing on conforming compilers.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/aux_/lambda_support.hpp">boost/mpl/aux_/lambda_support.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>arity</code></td><td>The metafunction's arity, i.e. the number of its template parameters, including the defaults. </td></tr>
<tr><td><code>fun</code></td><td>The metafunction's name. </td></tr>
<tr><td><code>params</code></td><td><a href="http://www.boost.org/libs/preprocessor/doc/index.html">PP</a>-tuple of the metafunction's parameter names, in their original order. </td></tr>
</table>
<p>
<h3>Example</h3>
<p>
<pre>
template&lt; typename T, typename U = int &gt; struct f
{
typedef T type[sizeof(U)];
<p>
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,f,(T,U))
};
<p>
typedef lambda&lt; f&lt;char,_1&gt; &gt;::type f_; <span class="cxx-comment">// use f in a lambda expression</span>
typedef apply1&lt;f_,long&gt;::type res;
BOOST_MPL_ASSERT_IS_SAME(res, char[sizeof(long)]);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Macros.html">Macros</a>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited November 12, 2003 1:29 am</body></html>