1<?xml version="1.0" encoding="utf-8" ?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" /> 7<title>The MPL Reference Manual: BOOST_MPL_AUX_LAMBDA_SUPPORT</title> 8<link rel="stylesheet" href="../style.css" type="text/css" /> 9</head> 10<body class="docframe refmanual"> 11<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Prev</a> <a href="./terminology.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group">Back Along</span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> 12<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./macros.html" class="navigation-link">Macros</a> / <a href="./broken-compiler-workarounds.html" class="navigation-link">Broken Compiler Workarounds</a> / <a href="./aux-lambda-support.html" class="navigation-link">BOOST_MPL_AUX_LAMBDA_SUPPORT</a></td> 13</tr></table><div class="header-separator"></div> 14<div class="section" id="boost-mpl-aux-lambda-support"> 15<h1><a class="toc-backref" href="./broken-compiler-workarounds.html#id1609">BOOST_MPL_AUX_LAMBDA_SUPPORT</a></h1> 16<div class="section" id="id1384"> 17<h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3> 18<pre class="literal-block"> 19#define <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(arity, fun, params) \ 20 <em>unspecified token sequence</em> \ 21/**/ 22</pre> 23</div> 24<div class="section" id="id1385"> 25<h3><a class="subsection-title" href="#description" name="description">Description</a></h3> 26<p>Enables metafunction <tt class="literal"><span class="pre">fun</span></tt> for the use in <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a>s on 27compilers that don't support partial template specialization or/and 28template template parameters. Expands to nothing on conforming compilers.</p> 29</div> 30<div class="section" id="id1386"> 31<h3><a class="subsection-title" href="#header" name="header">Header</a></h3> 32<pre class="literal-block"> 33#include <<a href="../../../../boost/mpl/aux_/lambda_support.hpp" class="header">boost/mpl/aux_/lambda_support.hpp</a>> 34</pre> 35</div> 36<div class="section" id="id1387"> 37<h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3> 38<table border="1" class="docutils table"> 39<colgroup> 40<col width="15%" /> 41<col width="32%" /> 42<col width="53%" /> 43</colgroup> 44<thead valign="bottom"> 45<tr><th class="head">Parameter</th> 46<th class="head">Requirement</th> 47<th class="head">Description</th> 48</tr> 49</thead> 50<tbody valign="top"> 51<tr><td><tt class="literal"><span class="pre">arity</span></tt></td> 52<td>An integral constant</td> 53<td>The metafunction's arity, i.e. the number of its 54template parameters, including the defaults.</td> 55</tr> 56<tr><td><tt class="literal"><span class="pre">fun</span></tt></td> 57<td>A legal identifier token</td> 58<td>The metafunction's name.</td> 59</tr> 60<tr><td><tt class="literal"><span class="pre">params</span></tt></td> 61<td>A <a class="reference external" href="http://www.boost.org/libs/preprocessor/doc/data/tuples.html" target="_top">PP-tuple</a></td> 62<td>A tuple of the metafunction's parameter names, in 63their original order, including the defaults.</td> 64</tr> 65</tbody> 66</table> 67</div> 68<div class="section" id="id1388"> 69<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3> 70<p>For any integral constant <tt class="literal"><span class="pre">n</span></tt>, a <a class="reference internal" href="./metafunction.html">Metafunction</a> <tt class="literal"><span class="pre">fun</span></tt>, and arbitrary types <tt class="literal"><span class="pre">A1</span></tt>,... <tt class="literal"><span class="pre">An</span></tt>:</p> 71<pre class="literal-block"> 72template< typename A1,<em>...</em> typename A<em>n</em> > struct fun 73{ 74 // <em>...</em> 75 76 <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(n, fun, (A1,<em>...</em>A<em>n</em>)) 77}; 78</pre> 79<table class="docutils field-list" frame="void" rules="none"> 80<col class="field-name" /> 81<col class="field-body" /> 82<tbody valign="top"> 83<tr class="field"><th class="field-name">Precondition:</th><td class="field-body">Appears in <tt class="literal"><span class="pre">fun</span></tt>'s scope, immediately followed by the scope-closing 84bracket (<tt class="literal"><span class="pre">}</span></tt>).</td> 85</tr> 86<tr class="field"><th class="field-name">Return type:</th><td class="field-body">None.</td> 87</tr> 88<tr class="field"><th class="field-name">Semantics:</th><td class="field-body">Expands to nothing and has no effect on conforming compilers. On compilers that 89don't support partial template specialization or/and template template parameters 90expands to an unspecified token sequence enabling <tt class="literal"><span class="pre">fun</span></tt> to participate in 91<a class="reference internal" href="./lambda-expression.html">Lambda Expression</a>s with the semantics described in this manual.</td> 92</tr> 93</tbody> 94</table> 95</div> 96<div class="section" id="id1389"> 97<h3><a class="subsection-title" href="#example" name="example">Example</a></h3> 98<pre class="literal-block"> 99template< typename T, typename U = int > struct f 100{ 101 typedef T type[sizeof(U)]; 102 103 <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(2, f, (T,U)) 104}; 105 106typedef <a href="./apply.html" class="identifier">apply</a><tt class="literal"><span class="pre">1</span></tt>< f<char,<a href="./placeholders.html" class="identifier">_1</a>>,long >::type r; 107<a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< r, char[sizeof(long)] > )); 108</pre> 109</div> 110<div class="section" id="id1390"> 111<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3> 112<p><a class="reference internal" href="./macros.html">Macros</a>, <a class="reference internal" href="./metafunctions.html">Metafunctions</a>, <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a></p> 113</div> 114</div> 115 116<div class="footer-separator"></div> 117<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Prev</a> <a href="./terminology.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group">Back Along</span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> 118<td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</div> 119Distributed under the Boost Software License, Version 1.0. (See accompanying 120file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body> 121</html> 122