...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Metafunctions / Concepts / Metafunction Class |
A metafunction class is a certain form of metafunction representation that enables higher-order metaprogramming. More precisely, it's a class with a publicly-accessible nested Metafunction called apply. Correspondingly, a metafunction class invocation is defined as invocation of its nested apply metafunction.
In the following table and subsequent specifications, f is a Metafunction Class.
Expression | Type | Complexity |
---|---|---|
f::apply::type | Any type | Unspecified. |
f::apply<>::type | Any type | Unspecified. |
f::apply<a1,...an>::type | Any type | Unspecified. |
typedef f::apply::type x;
Precondition: | f is a nullary Metafunction Class; f::apply::type is a type-name. |
---|---|
Semantics: | x is the result of the metafunction class invocation. |
typedef f::apply<>::type x;
Precondition: | f is a nullary Metafunction Class; f::apply<>::type is a type-name. |
---|---|
Semantics: | x is the result of the metafunction class invocation. |
typedef f::apply<a1,...an>::type x;
Precondition: | f is an n-ary metafunction class; apply is a Metafunction. |
---|---|
Semantics: | x is the result of the metafunction class invocation with the actual arguments a1,... an. |