1
.. Macros/Broken Compiler Workarounds//BOOST_MPL_AUX_LAMBDA_SUPPORT
3
BOOST_MPL_AUX_LAMBDA_SUPPORT
4
============================
11
#define BOOST_MPL_AUX_LAMBDA_SUPPORT(arity, fun, params) \\
12
|unspecified-token-seq| \\
20
Enables metafunction ``fun`` for the use in |Lambda Expression|\ s on
21
compilers that don't support partial template specialization or/and
22
template template parameters. Expands to nothing on conforming compilers.
30
#include <boost/mpl/aux\_/lambda_support.hpp>
36
+---------------+-------------------------------+---------------------------------------------------+
37
| Parameter | Requirement | Description |
38
+===============+===============================+===================================================+
39
| ``arity`` | An integral constant | The metafunction's arity, i.e. the number of its |
40
| | | template parameters, including the defaults. |
41
+---------------+-------------------------------+---------------------------------------------------+
42
| ``fun`` | A legal identifier token | The metafunction's name. |
43
+---------------+-------------------------------+---------------------------------------------------+
44
| ``params`` | A |PP-tuple| | A tuple of the metafunction's parameter names, in |
45
| | | their original order, including the defaults. |
46
+---------------+-------------------------------+---------------------------------------------------+
52
For any integral constant ``n``, a |Metafunction| ``fun``, and arbitrary types |A1...An|:
57
template< typename A1,\ |...| typename A\ *n* > struct fun
61
BOOST_MPL_AUX_LAMBDA_SUPPORT(n, fun, (A1,\ |...|\ A\ *n*\ ))
65
Appears in ``fun``\ 's scope, immediately followed by the scope-closing
72
Expands to nothing and has no effect on conforming compilers. On compilers that
73
don't support partial template specialization or/and template template parameters
74
expands to an unspecified token sequence enabling ``fun`` to participate in
75
|Lambda Expression|\ s with the semantics described in this manual.
83
template< typename T, typename U = int > struct f
85
typedef T type[sizeof(U)];
87
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, f, (T,U))
90
typedef apply\ ``1``\< f<char,_1>,long >::type r;
91
BOOST_MPL_ASSERT(( is_same< r, char[sizeof(long)] > ));
97
|Macros|, |Metafunctions|, |Lambda Expression|
100
.. |PP-tuple| replace:: `PP-tuple <http://www.boost.org/libs/preprocessor/doc/data/tuples.html>`__
103
.. copyright:: Copyright � 2001-2009 Aleksey Gurtovoy and David Abrahams
104
Distributed under the Boost Software License, Version 1.0. (See accompanying
105
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)