1.. Metafunctions/Concepts//Metafunction Class |20 2 3Metafunction Class 4================== 5 6Summary 7------- 8 9A *metafunction class* is a certain form of metafunction representation 10that enables higher-order metaprogramming. More precisely, it's a class 11with a publicly-accessible nested |metafunction| called ``apply``. 12Correspondingly, a metafunction class invocation is defined as invocation 13of its nested ``apply`` metafunction. 14 15 16Expression requirements 17----------------------- 18 19|In the following table...| ``f`` is a |Metafunction Class|. 20 21+-------------------------------+---------------------------+---------------------------+ 22| Expression | Type | Complexity | 23+===============================+===========================+===========================+ 24| ``f::apply::type`` | Any type | Unspecified. | 25+-------------------------------+---------------------------+---------------------------+ 26| ``f::apply<>::type`` | Any type | Unspecified. | 27+-------------------------------+---------------------------+---------------------------+ 28| ``f::apply<a1,...an>::type`` | Any type | Unspecified. | 29+-------------------------------+---------------------------+---------------------------+ 30 31 32Expression semantics 33-------------------- 34 35.. parsed-literal:: 36 37 typedef f::apply::type x; 38 39:Precondition: 40 ``f`` is a nullary |Metafunction Class|; ``f::apply::type`` is a *type-name*. 41 42:Semantics: 43 ``x`` is the result of the metafunction class invocation. 44 45 46.. ................................................................................... 47 48.. parsed-literal:: 49 50 typedef f::apply<>::type x; 51 52:Precondition: 53 ``f`` is a nullary |Metafunction Class|; ``f::apply<>::type`` is a *type-name*. 54 55:Semantics: 56 ``x`` is the result of the metafunction class invocation. 57 58 59.. ................................................................................... 60 61.. parsed-literal:: 62 63 typedef f::apply<a1,\ |...|\ a\ *n*\>::type x; 64 65:Precondition: 66 ``f`` is an *n*-ary metafunction class; ``apply`` is a |Metafunction|. 67 68:Semantics: 69 ``x`` is the result of the metafunction class 70 invocation with the actual arguments |a1...an|. 71 72 73Models 74------ 75 76* |always| 77* |arg| 78* |quote| 79* |numeric_cast| 80* |unpack_args| 81 82 83See also 84-------- 85 86|Metafunctions|, |Metafunction|, |Lambda Expression|, |Invocation|, |apply_wrap|, |bind|, |quote| 87 88 89.. copyright:: Copyright � 2001-2009 Aleksey Gurtovoy and David Abrahams 90 Distributed under the Boost Software License, Version 1.0. (See accompanying 91 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 92