Back to Arangodb

arg

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

3.12.9.12.6 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Composition and Argument Binding / arg |

arg

Synopsis

template< int n > struct[arg](./arg.html);

template<> struct[arg](./arg.html)<1>
{
    template< typename A1,_..._typename A_n_=_unspecified_>
    struct[apply](./apply.html){
        typedef A1 type;
    };
};_..._template<> struct[arg](./arg.html)<_n_>
{
    template< typename A1,_..._typename A_n_>
    struct[apply](./apply.html){
        typedef A_n_type;
    };
};

Description

arg<n> specialization is a Metafunction Class that return the nth of its arguments.

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

Parameters

ParameterRequirementDescription
nAn integral constantA number of argument to return.

Expression semantics

For any integral constant n in the range [1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY] and arbitrary types a1,... an:

typedef[apply\_wrap](./apply-wrap.html)_n_<[arg](./arg.html)<_n_>,a1,_..._a_n_>::type x;

| Return type: | A type. | | Semantics: | x is identical to an. |

Example

typedef[apply\_wrap](./apply-wrap.html)5<[arg](./arg.html)<1>,bool,char,short,int,long >::type t1;
typedef[apply\_wrap](./apply-wrap.html)5<[arg](./arg.html)<3>,bool,char,short,int,long >::type t3;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t1, bool > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t3, short > ));

See also

Composition and Argument Binding, Placeholders, lambda, bind, apply, apply_wrap

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