1
.. Metafunctions/Concepts//Trivial Metafunction |70
9
A |Trivial Metafunction| accepts a single argument of a class type ``x`` and
10
returns the ``x``\ 's nested type member ``x::name``, where ``name`` is
11
a placeholder token for the actual member's name accessed by a specific
12
metafunction's instance. By convention, all `trivial metafunctions`__ in MPL
13
are named after the members they provide assess to. For instance, a |Trivial
14
Metafunction| named ``first`` reaches for the ``x``\ 's nested member
17
__ `Trivial Metafunctions Summary`_
20
Expression requirements
21
-----------------------
23
|In the following table...| ``name`` is placeholder token for the names of
24
the |Trivial Metafunction| itself and the accessed member, and ``x`` is
25
a class type such that ``x::name`` is a valid *type-name*.
27
+---------------------------+-------------------+---------------------------+
28
| Expression | Type | Complexity |
29
+===========================+===================+===========================+
30
| ``name<x>::type`` | Any type | Constant time. |
31
+---------------------------+-------------------+---------------------------+
39
typedef name<x>::type r;
42
``x::name`` is a valid *type-name*.
45
``is_same<r,x::name>::value == true``.
59
|Metafunctions|, |Trivial Metafunctions|, |identity|
62
.. copyright:: Copyright � 2001-2009 Aleksey Gurtovoy and David Abrahams
63
Distributed under the Boost Software License, Version 1.0. (See accompanying
64
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)