source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/TrivialMetafunction.rst
@
12
| Last change on this file since 12 was 12, checked in by landauf, 18 years ago | |
|---|---|
| File size: 1.6 KB | |
Trivial Metafunction
Description
A |Trivial Metafunction| accepts a single argument of a class type x and returns the x's nested type member x::name, where name is a placeholder token for the actual member's name accessed by a specific metafunction's instance. By convention, all `trivial metafunctions`__ in MPL are named after the members they provide assess to. For instance, a |Trivial Metafunction| named first reaches for the x's nested member ::first.
Expression requirements
|In the following table...| name is placeholder token for the names of the |Trivial Metafunction| itself and the accessed member, and x is a class type such that x::name is a valid type-name.
| Expression | Type | Complexity |
|---|---|---|
| name<x>::type | Any type | Constant time. |
Expression semantics
typedef name<x>::type r;
| Precondition: | x::name is a valid type-name. |
|---|---|
| Semantics: | is_same<r,x::name>::value == true. |
See also
Note: See TracBrowser
for help on using the repository browser.










