1 .. Metafunctions/Invocation//apply |10
16 typedef |unspecified| type;
20 typename F, typename A1
24 typedef |unspecified| type;
30 typename F, typename A1,\ |...| typename An
34 typedef |unspecified| type;
39 , typename A1 = |unspecified|
41 , typename An = |unspecified|
45 typedef |unspecified| type;
53 Invokes a |Metafunction Class| or a |Lambda Expression| ``F`` with arguments ``A1``,... ``An``.
61 #include <boost/mpl/apply.hpp>
67 +---------------+-----------------------------------+-----------------------------------------------+
68 | Parameter | Requirement | Description |
69 +===============+===================================+===============================================+
70 | ``F`` | |Lambda Expression| | An expression to invoke. |
71 +---------------+-----------------------------------+-----------------------------------------------+
72 | |A1...An| | Any type | Invocation arguments. |
73 +---------------+-----------------------------------+-----------------------------------------------+
79 For any |Lambda Expression| ``f`` and arbitrary types ``a1``,... ``an``:
84 typedef apply\ *n*\<f,a1,\ |...|\ a\ *n*\>::type t;
85 typedef apply<f,a1,\ |...|\ a\ *n*\>::type t;
91 Equivalent to ``typedef apply_wrap``\ *n*\ ``< lambda<f>::type,a1,... an>::type t;``.
99 template< typename N1, typename N2 > struct int_plus
100 : int_<( N1::value + N2::value )>
104 typedef apply< int_plus<_1,_2>, int_<2>, int_<3> >::type r1;
105 typedef apply< quote\ ``2``\ <int_plus>, int_<2>, int_<3> >::type r2;
107 BOOST_MPL_ASSERT_RELATION( r1::value, ==, 5 );
108 BOOST_MPL_ASSERT_RELATION( r2::value, ==, 5 );
114 |Metafunctions|, |apply_wrap|, |lambda|, |quote|, |bind|
117 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
118 Distributed under the Boost Software License, Version 1.0. (See accompanying
119 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)