📄 trivialmetafunction.rst
字号:
.. Metafunctions/Concepts//Trivial Metafunction |70.. Copyright Aleksey Gurtovoy, David Abrahams 2007... Distributed under the Boost.. Software License, Version 1.0. (See accompanying.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)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`` isa 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 |TrivialMetafunction| named ``first`` reaches for the ``x``\ 's nested member ``::first``.__ `Trivial Metafunctions Summary`_Expression requirements-----------------------|In the following table...| ``name`` is placeholder token for the names of the |Trivial Metafunction| itself and the accessed member, and ``x`` isa class type such that ``x::name`` is a valid *type-name*.+---------------------------+-------------------+---------------------------+| Expression | Type | Complexity |+===========================+===================+===========================+| ``name<x>::type`` | Any type | Constant time. |+---------------------------+-------------------+---------------------------+Expression semantics--------------------.. parsed-literal:: typedef name<x>::type r;:Precondition: ``x::name`` is a valid *type-name*.:Semantics: ``is_same<r,x::name>::value == true``.Models------* |first|* |second|* |base|See also--------|Metafunctions|, |Trivial Metafunctions|, |identity|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -