]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | .. Macros/Configuration//BOOST_MPL_LIMIT_METAFUNCTION_ARITY |20 |
2 | ||
3 | BOOST_MPL_LIMIT_METAFUNCTION_ARITY | |
4 | ================================== | |
5 | ||
6 | Synopsis | |
7 | -------- | |
8 | ||
9 | .. parsed-literal:: | |
10 | ||
11 | #if !defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY) | |
12 | # define BOOST_MPL_LIMIT_METAFUNCTION_ARITY \\ | |
13 | |idic| \\ | |
14 | /\*\*/ | |
15 | #endif | |
16 | ||
17 | ||
18 | Description | |
19 | ----------- | |
20 | ||
21 | ``BOOST_MPL_LIMIT_METAFUNCTION_ARITY`` is an overridable configuration macro | |
22 | regulating the maximum supported arity of `metafunctions`__ and | |
23 | `metafunction classes`__. In this implementation of the | |
24 | library, ``BOOST_MPL_LIMIT_METAFUNCTION_ARITY`` has a default value of 5. To | |
25 | override the default limit, define ``BOOST_MPL_LIMIT_METAFUNCTION_ARITY`` to | |
26 | the desired maximum arity before including any library header. | |
27 | |preprocessed headers disclaimer| | |
28 | ||
29 | __ `Metafunction`_ | |
30 | __ `Metafunction Class`_ | |
31 | ||
32 | ||
33 | Example | |
34 | ------- | |
35 | ||
36 | .. parsed-literal:: | |
37 | ||
38 | #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS | |
39 | #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 2 | |
40 | ``#``\ include <boost/mpl/apply.hpp> | |
41 | ||
42 | using namespace boost::mpl; | |
43 | ||
44 | template< typename T1, typename T2 > struct second | |
45 | { | |
46 | typedef T2 type; | |
47 | }; | |
48 | ||
49 | template< typename T1, typename T2, typename T3 > struct third | |
50 | { | |
51 | typedef T3 type; | |
52 | }; | |
53 | ||
54 | typedef apply< second<_1,_2_>,int,long >::type r1; | |
55 | // typedef apply< third<_1,_2_,_3>,int,long,float >::type r2; // error! | |
56 | ||
57 | ||
58 | See also | |
59 | -------- | |
60 | ||
61 | |Macros|, |Configuration|, |BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS| | |
62 | ||
63 | ||
64 |