]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | .. Metafunctions/Invocation//unpack_args |30 |
2 | ||
3 | unpack_args | |
4 | =========== | |
5 | ||
6 | Synopsis | |
7 | -------- | |
8 | ||
9 | .. parsed-literal:: | |
10 | ||
11 | template< | |
12 | typename F | |
13 | > | |
14 | struct unpack_args | |
15 | { | |
16 | // |unspecified| | |
17 | // |...| | |
18 | }; | |
19 | ||
20 | ||
21 | Description | |
22 | ----------- | |
23 | ||
24 | A higher-order primitive transforming an *n*-ary |Lambda Expression| ``F`` into | |
25 | an unary |Metafunction Class| ``g`` accepting a single sequence of *n* arguments. | |
26 | ||
27 | ||
28 | Header | |
29 | ------ | |
30 | ||
31 | .. parsed-literal:: | |
32 | ||
33 | #include <boost/mpl/unpack_args.hpp> | |
34 | ||
35 | ||
36 | Model of | |
37 | -------- | |
38 | ||
39 | |Metafunction Class| | |
40 | ||
41 | ||
42 | Parameters | |
43 | ---------- | |
44 | ||
45 | +---------------+-----------------------+-------------------------------------------+ | |
46 | | Parameter | Requirement | Description | | |
47 | +===============+=======================+===========================================+ | |
48 | | ``F`` | |Lambda Expression| | A lambda expression to adopt. | | |
49 | +---------------+-----------------------+-------------------------------------------+ | |
50 | ||
51 | ||
52 | Expression semantics | |
53 | -------------------- | |
54 | ||
55 | For an arbitrary |Lambda Expression| ``f``, and arbitrary types |a1...an|: | |
56 | ||
57 | ||
58 | .. parsed-literal:: | |
59 | ||
60 | typedef unpack_args<f> g; | |
61 | ||
62 | :Return type: | |
63 | |Metafunction Class|. | |
64 | ||
65 | :Semantics: | |
66 | ``g`` is a unary |Metafunction Class| such that | |
67 | ||
68 | .. parsed-literal:: | |
69 | ||
70 | apply_wrap\ *n*\ < g, vector<a1,\ |...|\ a\ *n*\ > >::type | |
71 | ||
72 | is identical to | |
73 | ||
74 | .. parsed-literal:: | |
75 | ||
76 | apply<F,a1,\ |...|\ a\ *n*\ >::type | |
77 | ||
78 | ||
79 | Example | |
80 | ------- | |
81 | ||
82 | .. parsed-literal:: | |
83 | ||
84 | BOOST_MPL_ASSERT(( apply< | |
85 | unpack_args< is_same<_1,_2> > | |
86 | , vector<int,int> | |
87 | > )); | |
88 | ||
89 | ||
90 | See also | |
91 | -------- | |
92 | ||
93 | |Metafunctions|, |Lambda Expression|, |Metafunction Class|, |apply|, |apply_wrap|, |bind| | |
94 | ||
95 | ||
96 |