Back to Arangodb

Trivial Metafunction

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/trivial-metafunction.html

3.12.9.12.4 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Concepts / Trivial Metafunction |

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 and subsequent specifications, 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.

ExpressionTypeComplexity
name<x>::typeAny typeConstant time.

Expression semantics

typedef name<x>::type r;

| Precondition: | x::name is a valid type-name. | | Semantics: | is_same<r,x::name>::value == true. |

Models

See also

Metafunctions, Trivial Metafunctions, identity

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams 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) |