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

The MPL Reference Manual: apply

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 / Invocation / apply

apply

Synopsis

template<
      typename F
    >
struct apply0
{
    typedef unspecified type;
};
template<
      typename F, typename A1
    >
struct apply1
{
    typedef unspecified type;
};
...
template<
      typename F, typename A1,... typename An
    >
struct applyn
{
    typedef unspecified type;
};
template<
      typename F
    , typename A1 = unspecified
    ...
    , typename An = unspecified
    >
struct apply
{
    typedef unspecified type;
};

Description

Называется Метафункционный класс или Ламбда экспрессия Ф с аргументами A1,... A.

Parameters

Parameter Requirement Description
F Выражение Ламбды Выражение, чтобы вызвать.
A1,... An Любой тип Призывы.

Expression semantics

Для любого Ламбда экспрессия f и произвольных типов a1,...an:

typedef applyn<f,a1,...an>::type t;
typedef apply<f,a1,...an>::type t;
Return type:Any type.
Semantics:Equivalent to typedef apply_wrapn< lambda<f>::type,a1,... an>::type t;.

Example

template< typename N1, typename N2 > struct int_plus
    : int_<( N1::value + N2::value )>
{
};
typedef apply< int_plus<_1,_2>, int_<2>, int_<3> >::type r1;
typedef apply< quote2<int_plus>, int_<2>, int_<3> >::type r2;
BOOST_MPL_ASSERT_RELATION( r1::value, ==, 5 );
BOOST_MPL_ASSERT_RELATION( r2::value, ==, 5 );

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 20:05:22/0.0062150955200195/0