1 .. Metafunctions/Composition and Argument Binding//quote |40
12 template< typename P1 > class F
13 , typename Tag = |unspecified|
24 template< typename P1,\ |...| typename P\ *n* > class F
25 , typename Tag = |unspecified|
37 ``quote``\ *n* is a higher-order primitive that wraps an *n*-ary |Metafunction| to create
38 a corresponding |Metafunction Class|.
46 #include <boost/mpl/quote.hpp>
58 +---------------+-----------------------+-----------------------------------------------+
59 | Parameter | Requirement | Description |
60 +===============+=======================+===============================================+
61 | ``F`` | |Metafunction| | A metafunction to wrap. |
62 +---------------+-----------------------+-----------------------------------------------+
63 | ``Tag`` | Any type | A tag determining wrap semantics. |
64 +---------------+-----------------------+-----------------------------------------------+
70 For any *n*-ary |Metafunction| ``f`` and arbitrary type ``tag``:
75 typedef quote\ *n*\ <f> g;
76 typedef quote\ *n*\ <f,tag> g;
88 template< typename A1,\ |...| typename A\ *n* > struct apply
89 : f<A1,\ |...|\ A\ *n*\ >
94 if ``f<A1,...An>`` has a nested type member ``::type``, and to
100 template< typename A1,\ |...| typename A\ *n* > struct apply
102 typedef f<A1,\ |...|\ A\ *n*\ > type;
114 template< typename T > struct f1
120 typename T1, typename T2, typename T3, typename T4, typename T5
127 typedef quote\ ``1``\<f1>::apply<int>::type t1;
128 typedef quote\ ``5``\<f5>::apply<char,short,int,long,float>::type t5;
130 BOOST_MPL_ASSERT(( is_same< t1, int > ));
131 BOOST_MPL_ASSERT(( is_same< t5, f5<char,short,int,long,float> > ));
137 |Composition and Argument Binding|, |Invocation|, |bind|, |lambda|, |protect|, |apply|
140 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
141 Distributed under the Boost Software License, Version 1.0. (See accompanying
142 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)