Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

The MPL Reference Manual: Metafunction

Boost , ,

Boost C++ Libraries

...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

Metafunction

Description

A metafunction is a class or a class template that represents a function invocable at compile-time. An non-nullary metafunction is invoked by instantiating the class template with particular template parameters (metafunction arguments); the result of the metafunction application is accessible through the instantiation's nested type typedef. All metafunction's arguments must be types (i.e. only type template parameters are allowed). A metafunction can have a variable number of parameters. A nullary metafunction is represented as a (template) class with a nested type typename member.

Expression requirements

В следующей таблице и последующих спецификациях f является Meta function.

Expression Type Complexity
f::type Любой тип Не указано.
f<>::type Любой тип Не указано.
f::type Любой тип Не указано.

Expression semantics

typedef f::type x;
Precondition:f is a nullary Metafunction; f::type is a type-name.
Semantics:x is the result of the metafunction invocation.
typedef f<>::type x;
Precondition:f is a nullary Metafunction; f<>::type is a type-name.
Semantics:x is the result of the metafunction invocation.
typedef f<a1,... an>::type x;
Precondition:f is an n-ary Metafunction; a1,... an are types; f<a1,...an>::type is a type-name.
Semantics:x is the result of the metafunction invocation with the actual arguments a1,... an.

See also

Статья The MPL Reference Manual: Metafunction раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 17:55:04/0.0063138008117676/0