Back to Arangodb

apply

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/apply.html

3.12.9.12.9 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | 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[apply](./apply.html)_n_{
    typedef_unspecified_type;
};

template<
      typename F
    , typename A1 =_unspecified__..._, typename An =_unspecified_>
struct[apply](./apply.html){
    typedef_unspecified_type;
};

Description

Invokes a Metafunction Class or a Lambda Expression F with arguments A1,... An.

#include <[boost/mpl/apply.hpp](../../../../boost/mpl/apply.hpp)>

Parameters

ParameterRequirementDescription
FLambda ExpressionAn expression to invoke.
A1,... AnAny typeInvocation arguments.

Expression semantics

For any Lambda Expression f and arbitrary types a1,... an:

typedef[apply](./apply.html)_n_<f,a1,_..._a_n_>::type t;
typedef[apply](./apply.html)<f,a1,_..._a_n_>::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\_](./int.html)<( N1::value + N2::value )>
{
};

typedef[apply](./apply.html)< int_plus<[\_1](./placeholders.html),[\_2](./placeholders.html)>,[int\_](./int.html)<2>,[int\_](./int.html)<3> >::type r1;
typedef[apply](./apply.html)<[quote](./quote.html)2<int_plus>,[int\_](./int.html)<2>,[int\_](./int.html)<3> >::type r2;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( r1::value, ==, 5 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( r2::value, ==, 5 );

See also

Metafunctions, apply_wrap, lambda, quote, bind

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